31 #include "surfaceInterpolate.H" 41 template<
class BasicThermophysicalTransportModel>
49 BasicThermophysicalTransportModel
60 this->coeffDict_.found(
"DT")
86 W[i] = composition.
Wi(i);
93 template<
class BasicThermophysicalTransportModel>
109 DFuncs_[i].setSize(species.
size());
115 const word nameij(species[i] +
'-' + species[j]);
116 const word nameji(species[j] +
'-' + species[i]);
120 if (Ddict.
found(nameij) && Ddict.
found(nameji))
125 <<
"Binary mass diffusion coefficients " 126 "for both " << nameij <<
" and " << nameji
127 <<
" provided, using " << nameij <<
endl;
132 else if (Ddict.
found(nameij))
136 else if (Ddict.
found(nameji))
143 <<
"Binary mass diffusion coefficients for pair " 144 << nameij <<
" or " << nameji <<
" not provided" 159 if (this->coeffDict_.found(
"DT"))
182 template<
class BasicThermophysicalTransportModel>
193 this->momentumTransport().
rho()*Dii_[composition.
index(Yi)]
198 template<
class BasicThermophysicalTransportModel>
208 this->momentumTransport().
rho().boundaryField()[
patchi]
209 *Dii_[composition.
index(Yi)].boundaryField()[
patchi];
213 template<
class BasicThermophysicalTransportModel>
224 this->momentumTransport().alphaRhoPhi().
group()
264 composition.
Hs(i, this->thermo().p(), this->
thermo().
T())
279 composition.
Hs(i, this->thermo().p(), this->
thermo().
T())
292 template<
class BasicThermophysicalTransportModel>
341 composition.
Hs(i, this->thermo().p(), this->
thermo().
T())
356 composition.
Hs(i, this->thermo().p(), this->
thermo().
T())
368 template<
class BasicThermophysicalTransportModel>
376 BasicThermophysicalTransportModel::j(Yi)
377 + jexp_[composition.
index(Yi)];
381 template<
class BasicThermophysicalTransportModel>
389 BasicThermophysicalTransportModel::divj(Yi)
394 template<
class BasicThermophysicalTransportModel>
422 A(is, is) = -X[i]*Wm/(DD(i, d)*
W[d]);
423 B(is, is) = -(X[i]*Wm/
W[d] + (1 - X[i])*Wm/
W[i]);
432 A(is, is) -= X[j]*Wm/(DD(i, j)*
W[i]);
437 X[i]*(Wm/(DD(i, j)*
W[j]) - Wm/(DD(i, d)*
W[d]));
439 B(is, js) = X[i]*(Wm/
W[j] - Wm/
W[d]);
462 template<
class BasicThermophysicalTransportModel>
475 Y[i] = (*YPtrs[i])[
pi];
480 DD(i, j) = (*DijPtrs[i][j])[
pi];
485 transformDiffusionCoefficient();
503 (*DijPtrs[i][j])[
pi] = D(is, js);
516 template<
class BasicThermophysicalTransportModel>
529 YPtrs[i] = &Y[i].primitiveField();
532 DijPtrs[i][i] = &Dii_[i].primitiveFieldRef();
539 DijPtrs[i][j] = &Dij[i][j].primitiveFieldRef();
546 transformDiffusionCoefficientFields();
553 YPtrs[i] = &Y[i].boundaryField()[
patchi];
556 DijPtrs[i][i] = &Dii_[i].boundaryFieldRef()[
patchi];
563 DijPtrs[i][j] = &Dij[i][j].boundaryFieldRef()[
patchi];
570 transformDiffusionCoefficientFields();
575 template<
class BasicThermophysicalTransportModel>
607 "jexp" + Y[i].
name(),
617 Dij[i].setSize(Y.
size());
627 Dij[i].set(j, Dij[j][i].
clone());
645 if (i != d && i != j)
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
const char *const group
Group name for atomic constants.
const dimensionSet dimViscosity
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimArea
fluidReactionThermo & thermo
errorManipArg< error, int > exit(error &err, const int errNo=1)
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
A list of keyword definitions, which are a keyword followed by any number of values (e...
basicSpecieMixture & composition
label index(const volScalarField &Yi) const
Return the specie index of the given mass-fraction field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
T & ref() const
Return non-const reference or generate a fatal error.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
virtual void correct()
Update the diffusion coefficients and flux corrections.
void size(const label)
Override size to be inconsistent with allocated storage.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
volSymmTensorField invA(inv(I *UEqn.A()+drag->Dcu()))
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual scalar Wi(const label speciei) const =0
Molecular weight of the given specie [kg/kmol].
Calculate the snGrad of the given volField.
virtual scalar rho(const label speciei, const scalar p, const scalar T) const =0
Density [kg/m^3].
Specialisation of basicMixture for a mixture consisting of a number for molecular species...
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual volScalarField & p()=0
Pressure [Pa].
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
scalarList Y0(nSpecie, 0.0)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusion coefficient.
const dimensionSet dimTime
const dimensionSet & dimensions() const
Return dimensions.
Dimension set for the base types.
MaxwellStefan(const word &type, const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from a momentum transport model and a thermo model.
A class for handling words, derived from string.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-9/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
static word groupName(Name name, const word &group)
Calculate the laplacian of the given field.
virtual bool read()
Read thermophysicalTransport dictionary.
const dimensionSet dimDynamicViscosity
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
Calculate the divergence of the given field.
const Mesh & mesh() const
Return mesh.
const dimensionSet dimEnergy
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimMass
word name(const complex &)
Return a string representation of a complex.
laminarThermophysicalTransportModel ::thermoModel thermoModel
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
label size() const
Return the number of elements in the UPtrList.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const volScalarField & T() const =0
Temperature [K].
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A wordList with hashed indices for faster lookup by name.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const scalarList W(::W(thermo))
PtrList< volScalarField > & Y
virtual scalar Hs(const label speciei, const scalar p, const scalar T) const =0
Sensible enthalpy [J/kg].
Run-time selectable function of two variables.
virtual tmp< surfaceScalarField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction [kg/m^2/s].
laminarThermophysicalTransportModel ::momentumTransportModel momentumTransportModel
A class for managing temporary objects.
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Calculate the matrix for implicit and explicit sources.
dimensionSet transform(const dimensionSet &)
const speciesTable & species() const
Return the table of species.
label defaultSpecie() const
Return the index of the default specie.