Commit graph

2697 commits

Author SHA1 Message Date
Harry Moffat
fe6f8a29d0 Fixed error in the assignment operator. 2009-12-06 18:00:18 +00:00
Harry Moffat
646d31f8be Fixed an error in the assignment operator. 2009-12-06 17:59:27 +00:00
Harry Moffat
05753b6ef1 Fixed an Error in the assignment operator. 2009-12-06 17:58:08 +00:00
Harry Moffat
4f66d852b5 Added more expressive comments. 2009-12-06 17:56:45 +00:00
Harry Moffat
1a3af47eb9 took out checkMFSum() which is inappropriate in that context. 2009-12-06 17:55:43 +00:00
Harry Moffat
ae22fd8aca Added more initializations 2009-12-06 17:54:24 +00:00
Harry Moffat
55a743c2c0 Added more initializations 2009-12-06 17:53:44 +00:00
Harry Moffat
4f3715e119 Added more initializations 2009-12-06 17:52:51 +00:00
Harry Moffat
951420155d Added more initializations 2009-12-06 17:52:04 +00:00
John Hewson
9a142cfd87 Added "LiquidTransport.h" to the files included under transport.h 2009-12-02 23:07:43 +00:00
Harry Moffat
1f9d937d15 Fixed errors in the copy and assignment operator functions
for the IonsFromNeutralVPSSTP object.
2009-12-02 18:06:09 +00:00
Harry Moffat
c0249fa3d2 Modified TransportParams to eliminate a warning message due to the
constructor initialization list being out of order.
2009-12-02 02:07:02 +00:00
John Hewson
2cfa85402c Added parsing of velocityBasis from XML
<transport> 
	<speciesDiffusivity>
		<velocityBasis basis="mass">
Other valid values are "mole" or a species name.
This is loaded into LiquidTransportParams and then copied into
LiquidTransport in the initLiquidTransport() method.
2009-11-30 23:41:38 +00:00
John Hewson
4cee810c18 Added member to TransportBase to allow specification of the reference
velocity.  This allows selection of a mass-averaged, mole-averaged or
solvent specified reference velocity using the member m_velocityBasis
or the methods setVelocityBasis() and getVelocityBasis().  Parsing of
input needs to  be added for this still.  An enum has been added 
  enum VelocityBasis {
    VB_MOLEAVG = -2,
    VB_MASSAVG = -1  };
Other values can correspond to species indices.

In LiquidTransport, the Stefan Maxwell solve now checks to see what
the m_velocityBasis member says the reference velocity should be and
fills the matrix accordingly.  To allow mass averaged we have added
members m_massfracs and m_massfracs_tran.  

Added methods to extract the diffusion velocity in a similar manner to
the diffusive fluxes.  The diffusion velocity will be needed to not
force the porosity/tortuosity into the Transport classes for
porous flow.  These methods are getSpeciesVdiff() and
getSpeciesVdiffES().
2009-11-30 23:21:19 +00:00
John Hewson
36c19bd3a1 In LiquidTransport, we have changed the model for transport property
mixing.  Previously there was a LiquidTranMixingModel specification
and one or more matrices to describe interactions. For example, we had
the following for viscosity:
LiquidTranMixingModel viscMixModel;
DenseMatrix m_visc_Eij;
DenseMatrix m_visc_Sij;

The new model puts all of this into a new class
LiquidTranInteraction.  This class is built in the TransportFactory
and loaded into LiquidTransport Params.  In
LiquidTransport::initLiquid() pointers to these objects are
transferred to the following members:
    LiquidTranInteraction *m_viscMixModel;
    LiquidTranInteraction *m_lambdaMixModel;
    LiquidTranInteraction *m_diffMixModel;
    LiquidTranInteraction *m_radiusMixModel;

With these, the structure of methods that compute the mixture
transport properties is greatly simplified.  It should be possible to
only call these interaction models (they take as arguments the vectors
of individual species models that were previously added), but I need
to check this still.

I have also removed all binary diffusion coefficient matrices except
for m_bdiff.  Mainly this means that I removed the m_DiffCoeff_StefMax
member. Also removed is m_logViscSpecies[k] which was used only in the
mixture viscosity computation now handles outside.
2009-11-30 18:54:31 +00:00
John Hewson
d5dd5d7b22 Added mapping,m_LTImodelMap, between LiquidTranMixingModel and the
model name.

Added new method to build LiquidTranInteraction objects.
    virtual LiquidTranInteraction* newLTI( const XML_Node &trNode, 
					   TransportPropertyList tp_ind, 
					   LiquidTransportParams& trParam) ;
This methods calls teh new operator and the init() method for those
objects.  It also call the setParameters() method for those objects
that require additional trParam access.

In TransportFactory::getLiquidInteractionsTransportData() the majority
of the work is done by a switch statement that fills the different
LiquidTranInteraction* in LiquidTransportParams by calling newLTI().
The switch statement is over the type of transport property
(i.e. viscosity).  After some debugging checks we can remove the rest
of that method. (all of the XML node parsing  is moved to the
LiquidTranInteraction constructor.
2009-11-30 18:53:40 +00:00
John Hewson
27ad6fefa9 In LiquidTransportParams we added pointers to LiquidTranInteraction
objects for each of the transport properties: viscosity, thermalCond,
speciesDiffusivity,  electCond, hydroRadius.  This should allow us to
remove the members like visc_Eij, visc_Sij, thermalCond_Aij,
diff_Dij.  Also should be able to remove LiquidTranMixingModel model_*
members.  This removal is pending some testing. 

class LiquidTranInteraction has been further developed along with
subclasses.  The list of subclasses that should be in reasonable shape
is (all should be tested)
  class LTI_Solvent;
  class LTI_MoleFracs;
  class LTI_MassFracs;
  class LTI_Log_MoleFracs;
  class LTI_Pairwise_Interaction;
  class LTI_StokesEinstein;

The constructor takes only the TransportPropertyList enum.  The init:
    virtual void init( const XML_Node &compModelNode = 0, 
	  thermo_t* thermo = 0 );			  
takes the thermo object along with the XML node
<compositionDependence> which it parses.  The major methods for
LiquidTranInteraction are:
    virtual void setParameters( LiquidTransportParams& trParam ) 
that sets additional things required from trParam for some
subclasses.  
    virtual doublereal getMixTransProp( doublereal* speciesValues, doublereal *weightSpecies = 0 ) 
    virtual doublereal getMixTransProp( std::vector<LTPspecies*> LTPptrs )
that get a mixture averaged transport property.
    virtual DenseMatrix getMatrixTransProp( doublereal* speciesValues = 0 ) { return m_Dij; }
that get a matrix of interaction transport properties.

class LiquidTranInteraction holds members for various types of
interactions.  Some documentation of the purpose of each of these is
still required.
2009-11-30 18:53:11 +00:00
John Hewson
374641f3e2 Simply changed a variable name from m_hydroradius to m_hydroRadius. 2009-11-30 18:16:29 +00:00
John Hewson
db68520f70 Added methods to calculate the array of log concentration-like
derivatives of the log activity coefficients as used for computing
the transport coefficients.  These methods are 
 IonsFromNeutralVPSSTP::getdlnActCoeffdlnC()
and the internal method
 IonsFromNeutralVPSSTP::s_update_dlnActCoeff_dlnC()
2009-11-25 01:42:53 +00:00
John Hewson
6286be3661 Starting to refactor LiquidTransport interactions.
Added new file LiquidTransportParams.cpp.
2009-11-23 21:16:42 +00:00
Harry Moffat
6cfc37c1ec Additions to support some reversible reactions which have fractional
stoichiometries. These were not allowed previously. However, if
the species with fractional stoichiometries are in single-species
phases, this is ok, and actually necessary for some solid-phase
reactions.
2009-11-21 00:34:56 +00:00
John Hewson
7efdf53bb7 Added virtual destructors to LTPspecies class structure.
These do nothing for now.
2009-11-20 04:18:20 +00:00
John Hewson
5806bc13e7 The species-specific transport properties are now held in
vector<LTPspecies*> m_viscTempDep_Ns;
Previously they were held in two objects, the first identifying the
model type
    vector<LiquidTR_Model> m_viscTempDepType_Ns;
and the second holding the model coefficients
    std::vector<Coeff_T_>  m_coeffVisc_Ns; 

This greatly simplifies the assignment of coefficients from
LiquidTransportParams in initLiquid()

This also greatly simplifies the methods 
  void LiquidTransport::updateCond_T() 
  void LiquidTransport::updateViscosity_T() 
  void LiquidTransport::updateHydrodynamicRadius_T() 

Since the pointed-to-LTPspecies classes (subclasses actually) are
created with new in TransportFactory::newLTP, these are deleted in
~LiquidTransport()

Similar changes made to SimpleTransport.h SimpleTransport.cpp
2009-11-20 04:05:26 +00:00
John Hewson
c14ec7268a Created LTPspecies, LTPspecies_Const, LTPspecies_Arrhenius,
LTPspecies_Poly classes to hole a single transport property for a
single species.  

The class LiquidTransportData now holds pointers to these LTPspecies
classes.  It does not need to hold the model type or the coefficients
as these are contained in the LTPspecies classes.
2009-11-20 04:05:04 +00:00
John Hewson
46bf44d59f Added Factory method to return LTPspecies instances
virtual LTPspecies* 
      newLTP( const XML_Node &trNode, std::string &name, 
	      TransportPropertyList tp_ind, thermo_t* thermo) ;
This method returns a pointer to the appropriate subclass of
LTPspecies. 

Added maps of TransportPropertyList and LiquidTR
    std::map<std::string, TransportPropertyList> m_tranPropMap;
    std::map<std::string, LiquidTR_Model> m_LTRmodelMap;

Moved the method getArrhenius() from TransportFactory.cpp to
LiquidTransportData.cpp 

In TransportFactory::getLiquidSpeciesTransportData(), removed the
lines associated with parsing the XML for the individual transport
properties.  This XML parsing is now carried out within the LTPspecies
subclass constructors.  Instead, within
getLiquidSpeciesTransportData() we call newLTP() method that creates
these subclassed methods and returns a pointer to the new LTPspecies
object.
2009-11-20 04:04:33 +00:00
John Hewson
9f99d8acd6 Missed a method name change. 2009-11-17 00:34:46 +00:00
John Hewson
71a740c161 Catching MargulesVPSSTP up to prior commit (nomenclature change) 2009-11-15 04:49:05 +00:00
John Hewson
aae7d0b440 Added method
virtual void getdlnActCoeffdlnX(doublereal *dlnActCoeffdlnX) const;
to ThermoPhase, GibbsExcessVPSSTP, VPStandardStateTP and 
MargulesVPSSTP classes (i.e. the whole thermo tree).  
In GibbsExcessVPSSTP and above, these methods are not yet implemented.

In MargulesVPSSTP, the internal method 
void s_update_dlnActCoeff_dlnX() const;
does the work and stores the result in the member dlnActCoeffdlnX_Scaled_.
2009-11-15 04:40:37 +00:00
John Hewson
134b7acf3c Cleaned up stefan_maxwell_solve() method and it is now used in the
getSpeciesFluxes methods.  This involved changing from a
concentration-driven formulation for the Stefan-Maxwell equations to a
molefraction-driven formulation.  Also, the diffusion velocities are
what is computed internally as the primary variable.  It would be nice
to put these out instead of just the fluxes.  

There is still work to be done regarding mass-averaged velocities,
etc.  the current method uses a mole-averaged velocity at present.  We
really just need to bring mass fractions into the formulation for mass
averaged.
2009-11-14 23:32:40 +00:00
John Hewson
9d825b1c14 Minor changes. Mostly in comments and error reporting. 2009-11-13 00:01:18 +00:00
John Hewson
433914e449 LiquidTransport.cpp and LiquidTransport.h
Replaced viscosityModel_ member with m_viscMixModel.

Fixed bug in filling m_coeffVisc_Ns, etc., for the Arrhenius model.
Failed to use "push_back() to add to vector prior to this.  

For temperature-dependence option LTR_MODEL_POLY, corrected the
polynomial evaluations to correctly account for number of terms in the
polynomial. 

Viscosity mixture evaluations are now up to date with respect to the
use of LTR_MIXMODEL_MOLEFRACS and LTR_MIXMODEL_LOG_MOLEFRACS.

Added membersto hold activity coefficient info
    vector_fp actCoeffMolar_;
    vector_fp lnActCoeffMolarDelta_;

Added method  
getSpeciesFluxesES(...,const doublereal* grad_Phi,doublereal* fluxes))
that takes electrostatic potential gradient in addition to other gradients.
This then calls getSpeciesFluxesExt() to do the work.

Added new version of method LiquidTransport::update_Grad_lnAC().  The
new version calls m_thermo->getdlnActCoeffdlnX( DATA_PTR(grad_lnAC) );
These routines in the thermo object need to be provided.
2009-11-12 23:57:47 +00:00
Harry Moffat
35e4c9ea45 Turned on Keyword substition in all files. 2009-11-09 23:36:49 +00:00
Harry Moffat
0d6d5642b1 Added keywords property 2009-11-09 22:55:34 +00:00
John Hewson
33cf246c25 LiquidTransportParams.h TransportFactory.cpp
Filled out TransportFactory::getLiquidInteractionsTransportData to
parse interaction parameters.  About 220 lines of XML node extraction
added. 

LiquidTransport.h  LiquidTransport.cpp

Near the end of LiquidTransport::initLiquid, added the copying of
interaction parameters from the LiquidTransportParams object to
members:
+    m_visc_Eij = tr.visc_Eij;
+    m_visc_Sij = tr.visc_Sij;
+    m_lambda_Aij = tr.thermalCond_Aij;
+    m_diff_Dij = tr.diff_Dij;
+    m_radius_Aij = tr.radius_Aij;
Note that the last member was added to allow for hydrodynamic radius
mixing rules.
2009-10-28 04:02:28 +00:00
John Hewson
a4b9fd56c4 Added following members in LiquidTransport.cpp and LiquidTransport.h
associated with transport coefficient mixing properties: 
+    LiquidTranMixingModel m_viscMixModel;
+    LiquidTranMixingModel m_lambdaMixModel;
+    DenseMatrix m_lambda_Aij;
+    LiquidTranMixingModel m_diffMixModel;
+    DenseMatrix m_diff_Dij;
+    LiquidTranMixingModel m_radiusMixModel;

Removed 
-    int m_compositionDepType;
since it is replaced by the above property-dependent model
specifications.


Similarly in LiquidTransportParams.h added following 
+       LiquidTranMixingModel model_viscosity;
+       LiquidTranMixingModel model_thermalCond;
+       DenseMatrix  thermalCond_Aij;
+       LiquidTranMixingModel model_speciesDiffusivity;
+       DenseMatrix  diff_Dij;
+       LiquidTranMixingModel model_hydroradius;

Added some processing of the above variables from the XML file in
LiquidTransport::getLiquidInteractionsTransportData.
2009-10-28 02:30:59 +00:00
John Hewson
cc07e10207 LiquidTransport.cpp
Removed XML node processing of transport model (species interaction part) from
initLiquid().

m_molefracs_tran and m_concentrations are now properly dimensioned and copied.

TransportFactory.cpp

Corrections to XML node processing in getLiquidSpeciesTransportData
and getLiquidSpeciesInteractionData
2009-10-28 01:05:45 +00:00
John Hewson
217a0b4982 Slowly adding species-species transport interactions. 2009-10-24 02:04:06 +00:00
John Hewson
d06773652b Minor changes:
Added examples for transport mixing model XML
Changed "arrhenius" to "Arrhenius" is XML.
2009-10-24 00:57:49 +00:00
John Hewson
9c98965225 Added PDSS_SSVol.cpp to Makefile.in 2009-10-23 22:52:26 +00:00
John Hewson
45c2e077d1 LiquidTransport.h LiquidTransport.cpp
Added methods 
 void getSpeciesHydrodynamicRadius() -- similar to getSpeciesViscosities()
 void updateHydrodynamicRadius_T() -- similar to updateViscosities_T()
 void updateHydrodynamicRadius_C()
Added private members
 bool m_radi_temp_ok;
 bool m_radi_conc_ok;
2009-10-23 22:34:08 +00:00
Harry Moffat
60c9446340 Added corrected doxygen information. 2009-10-23 19:12:45 +00:00
Harry Moffat
c5b90826cb Added a missing function as a shell. 2009-10-23 19:11:14 +00:00
John Hewson
e52797d335 Minor changes to reflect changes in LiquidTransportParams,
LiquidTransportData and TransportParams.  However, the last set of
changes broke AqueosTransport because it uses the same property
coefficient vectors as those now moved to GasTransportParams.
2009-10-23 19:03:02 +00:00
John Hewson
dbef25a481 LiquidTransport.h LiquidTransport.cpp
Changed order of some prototypes in LiquidTransport.h to group public,
protected and private members better.

Renamed methods (consistency with other transport models) like 
virtual void update_temp() 
to
virtual bool update_T()  //note boolean return value

Added method getSpeciesHydrodynamicRadius(doublereal* const radius);
to fill the hydrodynamic radius array.

Added protected member vectors to hold information on
temperature-dependent species transport properties:
(1) model enumeration like  
vector<LiquidTR_Model> m_viscTempDepType_Ns;
(2) coefficients of temperature-dependent properties like
vector<Coeff_T_>  m_coeffVisc_Ns;  
These replace sets of variables like m_visc_A, m_visc_n, m_visc_Tact.
These are filled in LiquidTransport::initLiquid using
LiquidTransportData vector held within LiquidTransportParams

Species thermal conductivity variables now use "lambda" instead of
"cond" for simplicity.

Still need to work on species-species interactions.  Variables like
int m_compositionDepType will need to be replaced by property-specific
(i.e. viscosity, thermal conductivity) variables.  

Major changes to LiquidTransport::initLiquid(LiquidTransportParams&
tr)
- starting to bring in species-species interactions, but not there
yet.  
- complete rewrite of filling temperture-dependent property variables.
- added hydrodynamic radius and species diffusivity property parsing.
- 

LiquidTransport::thermalConductivity() now uses mass-fraction weighted
mixing rule.  Generality will follow.

LiquidTransport::updateViscosity
LiquidTransport::updateCond_T() hava been updated to use new
temperture-dependent property coefficients (m_lambdaTempDepType_Ns and
m_coeffLambda_Ns).

LiquidTransport::updateDiff() now computes Stefan-Maxwell interaction
parameters (D_ij) using Stokes-Einstein reltion.
2009-10-23 18:59:18 +00:00
John Hewson
2492db9750 TransportParams.h, LiquidTransportParams.h, LiquidTransportData.h
Moved temperature fits polynomials for viscosity, conductivity,
diffusivity from TransportParams to GasTransportParams.

Defined mixing model enumeration for liquid species-species
interactions in LiquidTransportParams
  enum LiquidTranMixingModel {
    LTR_MIXMODEL_NOTSET=-1,
    LTR_MIXMODEL_SOLVENT, 
    LTR_MIXMODEL_MOLEFRACS,
    LTR_MIXMODEL_MASSFRACS,
    LTR_MIXMODEL_LOG_MOLEFRACS,
    LTR_PAIRWISE_INTERACTIONS
  };

Removed species Arrhenius parameters from LiquidTransportParams.
These are now held in LiquidTransportData obejcts which are stored as
a vector in LiquidTransportParams

In LiquidTransportData, the hydrodynamic radius now holds coefficients
for temperature dependent models instead of just a constant value.
Also changed enumeration for polynomial from LTR_MODEL_COEFF to
LTR_MODEL_POLY.
2009-10-23 18:30:21 +00:00
John Hewson
d641b8f492 TransportFactory.h, TransportFactory.cpp
TransportFactory::setupLiquidTransport:

Removed "transport_database" argument since this can equally well be
pulled from thermo object also passed.  The "transport_databse" is now
called species_database (since it holds the vector of species nodes.  

The method getLiquidTransportData is renamed to
getLiquidSpeciesTransportData to reflect the fact that it just parses
the species node parts of the transport data.  

A new XML_Node, called phase_database and corresponding to the phase,
is defined.  If this has a child "transport" node, this node is passed
to the new method. 
    void TransportFactory::getLiquidInteractionsTransportData(
	const XML_Node &transportNode,  
	XML_Node& log, 
	const std::vector<std::string>& names, 
	LiquidTransportParams& tr);
This method, largely unfilled, will parse models for species-species
interactions in the liquid phase.  

TransportFactory::getLiquidSpeciesTransportData

Largely minor changes to the parsing of the species transport
properties, but allow all temperature dependence models for
hydrodynamic radius just for generality.  

LiquidTransportData objects are now pushed directly onto
LiquidTransportParams instead of filling members of
LiquidTransportParams. Removed most of the unit conversion and will
rely largely on the parser unit conversions.  Need to be careful
here, especially with the hydrodynamic radius which will likely be
given in Angstroms and not meters.
2009-10-23 18:23:15 +00:00
Harry Moffat
4776ef8f8d Added all of the files in the transport directory. 2009-10-21 15:10:27 +00:00
Harry Moffat
6de5cb2e99 Doxygen update - Still lots to do here. 2009-10-21 15:09:55 +00:00
Harry Moffat
23732968c6 doxygen warning messages removed. 2009-10-21 14:26:07 +00:00
Harry Moffat
d5b74320ac Doxygen updates
Started to document new PDSS formulations
2009-10-21 01:02:44 +00:00