32 #include "surfaceInterpolate.H"
43 template<
class BasicThermophysicalTransportModel>
44 void MaxwellStefan<BasicThermophysicalTransportModel>::
45 transformDiffusionCoefficient()
const
70 A(is, is) = -X[i]*Wm/(DD(i, d)*
W[d]);
71 B(is, is) = -(X[i]*Wm/
W[d] + (1 - X[i])*Wm/
W[i]);
80 A(is, is) -= X[j]*Wm/(DD(i, j)*
W[i]);
85 X[i]*(Wm/(DD(i, j)*
W[j]) - Wm/(DD(i, d)*
W[d]));
87 B(is, js) = X[i]*(Wm/
W[j] - Wm/
W[d]);
110 template<
class BasicThermophysicalTransportModel>
111 void MaxwellStefan<BasicThermophysicalTransportModel>::
112 transformDiffusionCoefficientFields()
const
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>
164 void MaxwellStefan<BasicThermophysicalTransportModel>::transform
166 List<PtrList<volScalarField>>& Dij
169 const PtrList<volScalarField>&
Y = this->
thermo().
Y();
175 YPtrs[i] = &
Y[i].primitiveField();
178 DijPtrs[i][i] = &Dii_[i].primitiveFieldRef();
185 DijPtrs[i][j] = &Dij[i][j].primitiveFieldRef();
192 transformDiffusionCoefficientFields();
199 YPtrs[i] = &
Y[i].boundaryField()[
patchi];
202 DijPtrs[i][i] = &Dii_[i].boundaryFieldRef()[
patchi];
209 DijPtrs[i][j] = &Dij[i][j].boundaryFieldRef()[
patchi];
216 transformDiffusionCoefficientFields();
221 template<
class BasicThermophysicalTransportModel>
231 Dii_.setSize(
Y.size());
232 jexp_.setSize(
Y.size());
263 Dij[i].setSize(
Y.size());
277 Dij[i].set(j, Dij[j][i].
clone());
295 if (i != d && i != j)
324 Di_.setSize(
Y.size());
329 Di_.set(i, Dii_[i].
clone().ptr());
340 Di_[i] -=
Y[j]/sumYnoti*Dij[i][j];
348 template<
class BasicThermophysicalTransportModel>
349 const PtrList<volScalarField>&
350 MaxwellStefan<BasicThermophysicalTransportModel>::Dii()
const
361 template<
class BasicThermophysicalTransportModel>
362 const PtrList<surfaceScalarField>&
363 MaxwellStefan<BasicThermophysicalTransportModel>::jexp()
const
374 template<
class BasicThermophysicalTransportModel>
375 const PtrList<volScalarField>&
376 MaxwellStefan<BasicThermophysicalTransportModel>::Di()
const
380 const PtrList<volScalarField>&
Y = this->
thermo().
Y();
381 Di_.setSize(
Y.size());
391 template<
class BasicThermophysicalTransportModel>
399 BasicThermophysicalTransportModel
408 DFuncs_(this->
thermo().species().size()),
413 ? this->
thermo().species().size()
417 W(this->
thermo().species().size()),
433 W[i] = this->
thermo().Wi(i).value();
440 template<
class BasicThermophysicalTransportModel>
450 const dictionary& coeffDict = this->typeDict();
456 DFuncs_[i].setSize(species.
size());
462 const word nameij(species[i] +
'-' + species[j]);
463 const word nameji(species[j] +
'-' + species[i]);
467 if (Ddict.
found(nameij) && Ddict.
found(nameji))
472 <<
"Binary mass diffusion coefficients "
473 "for both " << nameij <<
" and " << nameji
474 <<
" provided, using " << nameij <<
endl;
479 else if (Ddict.
found(nameij))
483 else if (Ddict.
found(nameji))
490 <<
"Binary mass diffusion coefficients for pair "
491 << nameij <<
" or " << nameji <<
" not provided"
513 if (coeffDict.
found(
"DT"))
543 template<
class BasicThermophysicalTransportModel>
552 this->momentumTransport().
rho()
553 *Di()[this->
thermo().specieIndex(Yi)]
558 template<
class BasicThermophysicalTransportModel>
566 this->momentumTransport().rho().boundaryField()[
patchi]
571 template<
class BasicThermophysicalTransportModel>
580 this->momentumTransport().
rho()*Dii()[this->
thermo().specieIndex(Yi)]
585 template<
class BasicThermophysicalTransportModel>
593 this->momentumTransport().rho().boundaryField()[
patchi]
598 template<
class BasicThermophysicalTransportModel>
609 this->
thermo().phaseName()
673 template<
class BasicThermophysicalTransportModel>
728 template<
class BasicThermophysicalTransportModel>
800 template<
class BasicThermophysicalTransportModel>
808 if (this->
thermo().specieIndex(Yi) == d)
819 this->
thermo().phaseName()
841 BasicThermophysicalTransportModel::j(Yi)
847 template<
class BasicThermophysicalTransportModel>
856 if (this->
thermo().specieIndex(Yi) == d)
879 BasicThermophysicalTransportModel::j(Yi,
patchi)
885 template<
class BasicThermophysicalTransportModel>
892 BasicThermophysicalTransportModel::divj(Yi)
897 template<
class BasicThermophysicalTransportModel>
900 BasicThermophysicalTransportModel::predict();
905 template<
class BasicThermophysicalTransportModel>
912 template<
class BasicThermophysicalTransportModel>
931 template<
class BasicThermophysicalTransportModel>
950 template<
class BasicThermophysicalTransportModel>
#define forAll(list, i)
Loop across all elements in list.
const dimensionSet & dimensions() const
Return dimensions.
const GeoMesh & mesh() const
Return mesh.
Run-time selectable function of two variables.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
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.
Base class for multi-component Maxwell Stefan generalised Fick's law diffusion coefficients based tem...
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
virtual tmp< volScalarField > D(const volScalarField &Yi) const
Mass diffusivity.
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...
label size() const
Return the number of elements in the UPtrList.
virtual const volScalarField & T() const =0
Temperature [K].
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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 const volScalarField & p() const =0
Pressure [Pa].
A wordList with hashed indices for faster lookup by name.
virtual const speciesTable & species() const =0
Return the table of species.
virtual PtrList< volScalarField > & Y()=0
Access the mass-fraction fields.
virtual label defaultSpecie() const =0
The index of the default specie.
label specieIndex(const volScalarField &Yi) const
Access the specie index of the given mass-fraction field.
Motion of the mesh specified as a list of pointMeshMovers.
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.
A class for handling words, derived from string.
volSymmTensorField invA(inv(I *UEqn.A()+drag->Dcu()))
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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 the laplacian of the field.
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.
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 > > laplacianCorrection(const VolField< scalar > &gamma, const VolField< Type > &vf)
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, fvMesh > &, const VolField< Type > &)
static const coefficient B("B", dimless, 18.678)
static const coefficient A("A", dimPressure, 611.21)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet & dimKinematicViscosity
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 & dimDynamicViscosity
const dimensionSet & dimMass
Ostream & endl(Ostream &os)
Add newline and flush stream.
void transform(GeometricField< Type, GeoMesh > &rtf, const GeometricField< tensor, GeoMesh > &trf, const GeometricField< Type, GeoMesh > &tf)
SurfaceField< scalar > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
scalarList W(const fluidMulticomponentThermo &thermo)
void evaluate(GeometricField< Type, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, GeoMesh > &x)
const dimensionSet & dimTime
VolField< scalar > volScalarField
const dimensionSet & dimPressure
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet & dimEnergy
void multiply(pointPatchField< Type > &f, const pointPatchField< scalar > &f1, const pointPatchField< Type > &f2)
const dimensionSet & dimArea
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
const dimensionSet & dimTemperature
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
PtrList< volScalarField > & Y
scalarList Y0(nSpecie, 0.0)
fluidMulticomponentThermo & thermo