31 #include "surfaceInterpolate.H"
41 template<
class BasicThermophysicalTransportModel>
69 A(is, is) = -X[i]*Wm/(DD(i, d)*
W[d]);
70 B(is, is) = -(X[i]*Wm/
W[d] + (1 - X[i])*Wm/
W[i]);
79 A(is, is) -= X[j]*Wm/(DD(i, j)*
W[i]);
84 X[i]*(Wm/(DD(i, j)*
W[j]) - Wm/(DD(i, d)*
W[d]));
86 B(is, js) = X[i]*(Wm/
W[j] - Wm/
W[d]);
109 template<
class BasicThermophysicalTransportModel>
122 Y[i] = (*YPtrs[i])[
pi];
127 DD(i, j) = (*DijPtrs[i][j])[
pi];
132 transformDiffusionCoefficient();
150 (*DijPtrs[i][j])[
pi] =
D(is, js);
163 template<
class BasicThermophysicalTransportModel>
166 List<PtrList<volScalarField>>& Dij
176 YPtrs[i] = &
Y[i].primitiveField();
179 DijPtrs[i][i] = &Dii_[i].primitiveFieldRef();
186 DijPtrs[i][j] = &Dij[i][j].primitiveFieldRef();
193 transformDiffusionCoefficientFields();
200 YPtrs[i] = &
Y[i].boundaryField()[
patchi];
203 DijPtrs[i][i] = &Dii_[i].boundaryFieldRef()[
patchi];
210 DijPtrs[i][j] = &Dij[i][j].boundaryFieldRef()[
patchi];
217 transformDiffusionCoefficientFields();
222 template<
class BasicThermophysicalTransportModel>
233 Dii_.setSize(
Y.size());
234 jexp_.setSize(
Y.size());
255 "jexp" +
Y[i].
name(),
265 Dij[i].setSize(
Y.size());
275 Dij[i].set(j, Dij[j][i].
clone());
293 if (i != d && i != j)
321 template<
class BasicThermophysicalTransportModel>
322 const PtrList<volScalarField>&
334 template<
class BasicThermophysicalTransportModel>
335 const PtrList<surfaceScalarField>&
349 template<
class BasicThermophysicalTransportModel>
357 BasicThermophysicalTransportModel
370 this->coeffDict_.
found(
"DT")
400 template<
class BasicThermophysicalTransportModel>
416 DFuncs_[i].setSize(species.
size());
422 const word nameij(species[i] +
'-' + species[j]);
423 const word nameji(species[j] +
'-' + species[i]);
427 if (Ddict.
found(nameij) && Ddict.
found(nameji))
432 <<
"Binary mass diffusion coefficients "
433 "for both " << nameij <<
" and " << nameji
434 <<
" provided, using " << nameij <<
endl;
439 else if (Ddict.
found(nameij))
443 else if (Ddict.
found(nameji))
450 <<
"Binary mass diffusion coefficients for pair "
451 << nameij <<
" or " << nameji <<
" not provided"
466 if (this->coeffDict_.found(
"DT"))
489 template<
class BasicThermophysicalTransportModel>
505 template<
class BasicThermophysicalTransportModel>
515 this->momentumTransport().
rho().boundaryField()[
patchi]
520 template<
class BasicThermophysicalTransportModel>
531 this->momentumTransport().alphaRhoPhi().
group()
599 template<
class BasicThermophysicalTransportModel>
675 template<
class BasicThermophysicalTransportModel>
695 this->momentumTransport().alphaRhoPhi().
group()
717 BasicThermophysicalTransportModel::j(Yi)
723 template<
class BasicThermophysicalTransportModel>
731 BasicThermophysicalTransportModel::divj(Yi)
736 template<
class BasicThermophysicalTransportModel>
739 BasicThermophysicalTransportModel::predict();
744 template<
class BasicThermophysicalTransportModel>
751 template<
class BasicThermophysicalTransportModel>
763 template<
class BasicThermophysicalTransportModel>
775 template<
class BasicThermophysicalTransportModel>
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
static const Foam::dimensionedScalar D("D", Foam::dimTemperature, 257.14)
#define forAll(list, i)
Loop across all elements in list.
const dimensionSet & dimensions() const
Return dimensions.
const Mesh & mesh() const
Return mesh.
Run-time selectable function of two variables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
static word groupName(Name name, const word &group)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
virtual bool movePoints()
Update for mesh motion.
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusion coefficient.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
virtual void predict()
Update the diffusion coefficients and flux corrections.
virtual void mapMesh(const polyMeshMap &map)
Update from another mesh using the given map.
virtual tmp< surfaceScalarField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction [kg/m^2/s].
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
virtual void distribute(const polyDistributionMap &map)
Redistribute or update using the given distribution map.
MaxwellStefan(const word &type, const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from a momentum transport model and a thermo model.
BasicThermophysicalTransportModel::thermoModel thermoModel
BasicThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
virtual bool read()
Read thermophysicalTransport dictionary.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Specialisation of basicMixture for a mixture consisting of a number for molecular species.
virtual scalar rho(const label speciei, const scalar p, const scalar T) const =0
Density [kg/m^3].
virtual scalar Hs(const label speciei, const scalar p, const scalar T) const =0
Sensible enthalpy [J/kg].
const speciesTable & species() const
Return the table of species.
label defaultSpecie() const
Return the index of the default specie.
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
label index(const volScalarField &Yi) const
Return the specie index of the given mass-fraction field.
virtual const volScalarField & T() const =0
Temperature [K].
A list of keyword definitions, which are a keyword followed by any number of values (e....
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Dimension set for the base types.
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
virtual volScalarField & p()=0
Pressure [Pa].
A wordList with hashed indices for faster lookup by name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Base class for multi-component Maxwell Stefan generalised Fick's law diffusion coefficients based tem...
A class for handling words, derived from string.
volSymmTensorField invA(inv(I *UEqn.A()+drag->Dcu()))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Calculate the divergence of the given field.
Calculate the laplacian of the given field.
Calculate the snGrad of the given volField.
Calculate the matrix for implicit and explicit sources.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
#define WarningInFunction
Report a warning using Foam::Warning.
const char *const group
Group name for atomic constants.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, volMesh > &, const VolField< Type > &)
tmp< fvMatrix< Type > > laplacianCorrection(const VolField< scalar > &gamma, const VolField< Type > &vf)
const dimensionSet dimViscosity
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimDynamicViscosity
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 dimEnergy
Ostream & endl(Ostream &os)
Add newline and flush stream.
SurfaceField< scalar > surfaceScalarField
const dimensionSet dimTime
scalarList W(const fluidMulticomponentThermo &thermo)
VolField< scalar > volScalarField
dimensionSet transform(const dimensionSet &)
const dimensionSet dimMass
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
const dimensionSet dimArea
word name(const complex &)
Return a string representation of a complex.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void multiply(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
scalarList Y0(nSpecie, 0.0)
basicSpecieMixture & composition
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo