21 #ifndef CT_TRANSPORTBASE_H
22 #define CT_TRANSPORTBASE_H
30 class TransportParams;
31 class GasTransportParams;
32 class LiquidTransportParams;
33 class SolidTransportData;
40 const int CK_Mode = 10;
44 const int cMulticomponent = 200;
45 const int CK_Multicomponent = 202;
46 const int cMixtureAveraged = 210;
47 const int CK_MixtureAveraged = 211;
48 const int cSolidTransport = 300;
49 const int cDustyGasTransport = 400;
50 const int cUserTransport = 500;
51 const int cFtnTransport = 600;
52 const int cLiquidTransport = 700;
53 const int cAqueousTransport = 750;
54 const int cSimpleTransport = 770;
55 const int cRadiativeTransport = 800;
56 const int cWaterTransport = 721;
57 const int cPecosTransport = 900;
251 return err(
"viscosity");
261 err(
"getSpeciesViscosities");
271 return err(
"bulkViscosity");
278 return err(
"ionConductivity");
288 err(
"getSpeciesIonConductivity");
306 err(
"mobilityRatio");
316 err(
"getSpeciesMobilityRatio");
345 err(
"selfDiffusion");
357 err(
"getSpeciesSelfDiffusion");
367 return err(
"thermalConductivity");
374 return err(
"electricalConductivity");
394 err(
"getMobilities");
415 err(
"getFluidMobilities");
438 err(
"getElectricConduct");
456 const doublereal* grad_T,
458 const doublereal* grad_X,
460 const doublereal* grad_V,
461 doublereal* current) {
462 err(
"getElectricCurrent");
488 size_t ldx,
const doublereal*
const grad_X,
489 size_t ldf, doublereal*
const fluxes);
510 const doublereal* grad_T,
512 const doublereal* grad_X,
514 const doublereal* grad_Phi,
515 doublereal* fluxes) {
535 const doublereal* grad_T,
537 const doublereal* grad_X,
540 err(
"getSpeciesVdiff");
562 const doublereal* grad_T,
564 const doublereal* grad_X,
566 const doublereal* grad_Phi,
585 const doublereal*
const state2,
const doublereal delta,
586 doublereal*
const cfluxes) {
587 err(
"getMolarFluxes");
604 const doublereal* state2, doublereal delta,
605 doublereal* mfluxes) {
606 err(
"getMassFluxes");
626 err(
"getThermalDiffCoeffs");
637 err(
"getBinaryDiffCoeffs");
652 err(
"getMultiDiffCoeffs");
666 err(
"getMixDiffCoeffs");
671 err(
"getMixDiffCoeffsMole");
676 err(
"getMixDiffCoeffsMass");
695 virtual void setParameters(
const int type,
const int k,
const doublereal*
const p);
831 doublereal
err(
const std::string& msg)
const;
virtual void getMixDiffCoeffsMole(doublereal *const d)
Returns a vector of mixture averaged diffusion coefficients.
This structure holds transport model parameters relevant to transport in ideal gases with a kinetic t...
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the matrix of binary diffusion coefficients [m^2/s].
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range Throws an exception if k is greater than nSpecies(...
virtual void selfDiffusion(doublereal *const selfDiff)
Returns the self diffusion coefficients of the species in the phase.
Transport(thermo_t *thermo=0, size_t ndim=1)
Constructor.
virtual int model() const
Transport model.
const VelocityBasis VB_SPECIES_1
Diffusion velocities are based on the relative motion wrt species 1.
size_t m_nDim
Number of dimensions used in flux expressions.
Factory class for creating new instances of classes derived from Transport.
thermo_t * m_thermo
pointer to the object representing the phase
virtual doublereal bulkViscosity()
The bulk viscosity in Pa-s.
void setVelocityBasis(VelocityBasis ivb)
Sets the velocity basis.
Base class for transport property managers.
virtual void getSpeciesMobilityRatio(double **mobRat)
Returns the pure species limit of the mobility ratios.
virtual bool initSolid(SolidTransportData &tr)
Called by TransportFactory to set parameters.
virtual void getElectricCurrent(int ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_V, doublereal *current)
Compute the electric current density in A/m^2.
virtual void getSpeciesViscosities(doublereal *const visc)
Returns the pure species viscosities.
size_t nDim() const
Return the number of dimensions in flux expressions.
void finalize()
Enable the transport object for use.
Base class for a phase with thermodynamic properties.
int VelocityBasis
The diffusion fluxes must be referenced to a particular reference fluid velocity. ...
Class LiquidTransportParams holds transport model parameters relevant to transport in mixtures...
virtual void getSpeciesVdiffES(size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_Phi, doublereal *Vdiff)
Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole f...
doublereal err(const std::string &msg) const
Error routine.
virtual void getMassFluxes(const doublereal *state1, const doublereal *state2, doublereal delta, doublereal *mfluxes)
Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two nearby points.
VelocityBasis getVelocityBasis() const
Gets the velocity basis.
const VelocityBasis VB_SPECIES_3
Diffusion velocities are based on the relative motion wrt species 3.
void checkSpeciesArraySize(size_t kk) const
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies()...
virtual void setParameters(const int type, const int k, const doublereal *const p)
Set model parameters for derived classes.
virtual void getSpeciesFluxesES(size_t ndim, const doublereal *grad_T, size_t ldx, const doublereal *grad_X, size_t ldf, const doublereal *grad_Phi, doublereal *fluxes)
Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole ...
virtual doublereal thermalConductivity()
Returns the mixture thermal conductivity in W/m/K.
virtual doublereal viscosity()
void setNDim(const int ndim)
Set the number of dimensions to be expected in flux expressions.
virtual doublereal ionConductivity()
The ionic conductivity in 1/ohm/m.
virtual void getMobilities(doublereal *const mobil_e)
Get the Electrical mobilities (m^2/V/s).
virtual void getSpeciesSelfDiffusion(double **selfDiff)
Returns the pure species self diffusion in solution of each species.
virtual void getMultiDiffCoeffs(const size_t ld, doublereal *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
virtual void mobilityRatio(double *mobRat)
Returns the pointer to the mobility ratios of the species in the phase.
bool m_ready
true if finalize has been called
const VelocityBasis VB_MOLEAVG
Diffusion velocities are based on the mole averaged velocities.
virtual void getMixDiffCoeffs(doublereal *const d)
Returns a vector of mixture averaged diffusion coefficients.
virtual void getMixDiffCoeffsMass(doublereal *const d)
Returns a vector of mixture averaged diffusion coefficients.
virtual bool initLiquid(LiquidTransportParams &tr)
Called by TransportFactory to set parameters.
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
virtual doublereal electricalConductivity()
size_t m_nsp
Number of species.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].
const VelocityBasis VB_MASSAVG
Diffusion velocities are based on the mass averaged velocity.
virtual void setThermo(thermo_t &thermo)
Specifies the ThermoPhase object.
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
virtual doublereal getElectricConduct()
Compute the mixture electrical conductivity (S m-1) at the current conditions of the phase (Siemens m...
const VelocityBasis VB_SPECIES_2
Diffusion velocities are based on the relative motion wrt species 2.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
virtual void getMolarFluxes(const doublereal *const state1, const doublereal *const state2, const doublereal delta, doublereal *const cfluxes)
Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
virtual void getSpeciesFluxes(size_t ndim, const doublereal *const grad_T, size_t ldx, const doublereal *const grad_X, size_t ldf, doublereal *const fluxes)
Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, given the gradients in mole fraction and temperature.
Class SolidTransportData holds transport parameters for a specific solid-phase species.
int m_velocityBasis
Velocity basis from which diffusion velocities are computed.
virtual bool initGas(GasTransportParams &tr)
Called by TransportFactory to set parameters.
virtual void getFluidMobilities(doublereal *const mobil_f)
Get the fluid mobilities (s kmol/kg).
const VelocityBasis VB_SPECIES_0
Diffusion velocities are based on the relative motion wrt species 0.
virtual void getSpeciesVdiff(size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, doublereal *Vdiff)
Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole f...
virtual void getSpeciesIonConductivity(doublereal *const ionCond)
Returns the pure species ionic conductivity.