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>
377 if (composition.
index(Yi) == d)
388 this->momentumTransport().alphaRhoPhi().
group()
410 BasicThermophysicalTransportModel::j(Yi)
411 + jexp_[composition.
index(Yi)];
416 template<
class BasicThermophysicalTransportModel>
424 BasicThermophysicalTransportModel::divj(Yi)
429 template<
class BasicThermophysicalTransportModel>
457 A(is, is) = -X[i]*Wm/(DD(i, d)*
W[d]);
458 B(is, is) = -(X[i]*Wm/
W[d] + (1 - X[i])*Wm/
W[i]);
467 A(is, is) -= X[j]*Wm/(DD(i, j)*
W[i]);
472 X[i]*(Wm/(DD(i, j)*
W[j]) - Wm/(DD(i, d)*
W[d]));
474 B(is, js) = X[i]*(Wm/
W[j] - Wm/
W[d]);
497 template<
class BasicThermophysicalTransportModel>
510 Y[i] = (*YPtrs[i])[
pi];
515 DD(i, j) = (*DijPtrs[i][j])[
pi];
520 transformDiffusionCoefficient();
538 (*DijPtrs[i][j])[
pi] = D(is, js);
551 template<
class BasicThermophysicalTransportModel>
564 YPtrs[i] = &Y[i].primitiveField();
567 DijPtrs[i][i] = &Dii_[i].primitiveFieldRef();
574 DijPtrs[i][j] = &Dij[i][j].primitiveFieldRef();
581 transformDiffusionCoefficientFields();
588 YPtrs[i] = &Y[i].boundaryField()[
patchi];
591 DijPtrs[i][i] = &Dii_[i].boundaryFieldRef()[
patchi];
598 DijPtrs[i][j] = &Dij[i][j].boundaryFieldRef()[
patchi];
605 transformDiffusionCoefficientFields();
610 template<
class BasicThermophysicalTransportModel>
642 "jexp" + Y[i].
name(),
652 Dij[i].setSize(Y.
size());
662 Dij[i].set(j, Dij[j][i].
clone());
680 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)
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...
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-10/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()
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))
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.
volSymmTensorField invA(inv(I *UEqn.A()+drag->Dcu()))
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.
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.