64 Foam::IOobject Foam::momentumTransferSystem::io(
const phaseSystem& fluid)
const
66 typeIOobject<IOdictionary> result
69 fluid.mesh().time().constant(),
79 modelName<blendedDragModel>(),
80 modelName<blendedVirtualMassModel>(),
81 modelName<blendedLiftModel>(),
82 modelName<blendedWallLubricationModel>(),
83 modelName<blendedTurbulentDispersionModel>()
86 OStringStream modelEntriesString;
89 modelEntriesString<< modelEntries[i];
90 if (i < modelEntries.size() - 2) modelEntriesString<<
", ";
91 if (i == modelEntries.size() - 2) modelEntriesString<<
" and ";
94 if (!result.headerOk())
99 <<
"Specifying momentum transfer model entries - "
100 << modelEntriesString.str().c_str() <<
" - in "
101 << fluid.relativeObjectPath() <<
" is deprecated. These "
102 <<
"entries should now be specified in "
103 << result.relativeObjectPath() <<
"." <<
endl;
109 if (!fluid.found(modelEntries[i]))
continue;
112 <<
"Momentum transfer model entries - "
113 << modelEntriesString.str().c_str() <<
" - in "
114 << fluid.relativeObjectPath() <<
" are no longer used. These "
115 <<
"entries are now read from " << result.relativeObjectPath()
126 template<
class ModelType>
129 const word key = modelName<ModelType>();
133 ? fluid_.subDict(key)
138 void Foam::momentumTransferSystem::addTmpField
146 result.
ref() += field;
156 result = field().clone();
192 wallLubricationModels_
200 turbulentDispersionModels_
256 wallLubricationModels_,
257 wallLubricationModelIter
261 wallLubricationModelIter()->interface();
282 forAll(fluid_.movingPhases(), movingPhasei)
284 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
299 turbulentDispersionModels_,
300 turbulentDispersionModelIter
304 turbulentDispersionModelIter()->interface();
311 const volScalarField alpha12(interface.phase1() + interface.phase2());
317 /
max(alpha12, interface.phase1().residualAlpha())
318 )*fluid_.mesh().magSf()
325 /
max(alpha12, interface.phase2().residualAlpha())
326 )*fluid_.mesh().magSf()
329 addField(interface.phase1(),
"F", Df*snGradAlpha1By12, Fs);
330 addField(interface.phase2(),
"F", Df*snGradAlpha2By12, Fs);
374 wallLubricationModels_,
375 wallLubricationModelIter
379 wallLubricationModelIter()->interface();
400 forAll(fluid_.movingPhases(), movingPhasei)
402 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
417 turbulentDispersionModels_,
418 turbulentDispersionModelIter
422 turbulentDispersionModelIter()->interface();
429 const volScalarField alpha12(interface.phase1() + interface.phase2());
435 /
max(alpha12, interface.phase1().residualAlpha())
436 )*fluid_.mesh().magSf()
443 /
max(alpha12, interface.phase2().residualAlpha())
444 )*fluid_.mesh().magSf()
447 addField(interface.phase1(),
"F", Df*snGradAlpha1By12, Ffs);
448 addField(interface.phase2(),
"F", Df*snGradAlpha2By12, Ffs);
455 void Foam::momentumTransferSystem::invADVs
460 const label n = ADVs.size();
472 AD(i, j) = ADVs[i][j][ci];
489 ADVs[i][j][ci] = source[i];
496 template<
class GeoMesh>
497 void Foam::momentumTransferSystem::invADVs
499 PtrList<PtrList<GeometricField<scalar, GeoMesh>>>& ADVs
502 const label n = ADVs.size();
504 List<UPtrList<scalarField>> ADps(
n);
512 ADps[i].set(j, &ADVs[i][j]);
526 ADps[i].set(j, &ADVs[i][j].boundaryFieldRef()[
patchi]);
535 void Foam::momentumTransferSystem::invADVs
551 invADVs[i].set(i, As[i].
clone());
557 labelList movingPhases(fluid_.phases().size(), -1);
558 forAll(fluid_.movingPhases(), movingPhasei)
560 movingPhases[fluid_.movingPhases()[movingPhasei].index()] =
578 Kds_.insert(dragModelIter.key(), tKd.ptr());
586 !interface.phase1().stationary()
587 && interface.phase1().U()()
588 .boundaryField()[
patchi].fixesValue()
591 !interface.phase2().stationary()
592 && interface.phase2().U()()
593 .boundaryField()[
patchi].fixesValue()
605 const phaseModel& otherPhase = iter.otherPhase();
618 invADVs[i][i] += Kdij;
619 invADVfs[i][i] += Kdijf;
621 const label j = movingPhases[otherPhase.
index()];
625 invADVs[i].set(j, -Kdij);
626 invADVfs[i].set(j, -Kdijf);
643 if (!invADVs[i].set(j))
688 if (i != -1 && !ADUDts.
set(i))
691 ADUDts.
set(i, DUDt.
A());
692 HDUDts.
set(i, DUDt.
H());
711 const phaseModel& otherPhase = iter.otherPhase();
725 invADVs[i][i] += AVm;
737 const label j = movingPhases[otherPhase.
index()];
743 invADVs[i][j] -= AVm;
758 momentumTransferSystem::invADVs(invADVs);
759 momentumTransferSystem::invADVs(invADVfs);
780 labelList movingPhases(fluid_.phases().size(), -1);
781 forAll(fluid_.movingPhases(), movingPhasei)
783 movingPhases[fluid_.movingPhases()[movingPhasei].index()] =
800 const phaseModel& otherPhase = iter.otherPhase();
816 invADVfs[i][i] += Kdfij;
818 const label j = movingPhases[otherPhase.
index()];
822 invADVfs[i].
set(j, -Kdfij);
832 if (!invADVfs[i].set(j))
866 if (i != -1 && !AUgradUs.
set(i))
869 AUgradUs.
set(i, UgradU.
A());
870 HUgradUs.
set(i, UgradU.
H());
889 const phaseModel& otherPhase = iter.otherPhase();
915 fluid_.MRF().absolute
917 phase.
phi()().oldTime()
926 const label j = movingPhases[otherPhase.
index()];
942 fluid_.MRF().absolute
944 otherPhase.
phi()().oldTime()
972 forAll(fluid_.movingPhases(), movingPhasei)
974 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
989 turbulentDispersionModels_,
990 turbulentDispersionModelIter
994 turbulentDispersionModelIter()->interface();
1010 /
max(alpha1f + alpha2f, interface.phase1().residualAlpha())
1015 rAs[interface.phase1().index()],
1016 rAs[interface.phase2().index()]
1018 *turbulentDispersionModelIter()->
D()
1033 forAll(fluid_.movingPhases(), movingPhasei)
1035 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
1066 forAll(fluid_.movingPhases(), movingPhasei)
1068 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
1097 const phaseModel& otherPhase = iter.otherPhase();
1098 const label otherPhasei = otherPhase.
index();
1111 *(VmDdtCorrs[phasei] - VmDdtCorrs[otherPhasei]),
1128 labelList movingPhases(fluid_.phases().size(), -1);
1129 forAll(fluid_.movingPhases(), movingPhasei)
1131 movingPhases[fluid_.movingPhases()[movingPhasei].index()] =
1136 forAll(fluid_.movingPhases(), movingPhasei)
1153 const phaseModel& otherPhase = iter.otherPhase();
1156 const label j = movingPhases[otherPhase.
index()];
1169 K1*(j == -1 ? -Uphis[i] : (Uphis[j] - Uphis[i])),
1178 *(j == -1 ? -phase.
phi() : (otherPhase.
phi() - phase.
phi())),
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Boundary & boundaryFieldRef()
Return a 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,.
A HashTable specialisation for hashing pointers.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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.
void clear()
Clear the list, i.e. set size to zero.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
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.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
T lookupOrDefault(const word &, const T &, const bool writeDefault=writeOptionalEntries > 0) const
Find and return a T, if not found return the given default.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
tmp< volScalarField > A() const
Return the central coefficient.
tmp< VolField< Type > > H() const
Return the H operation source.
Class which provides interfacial momentum transfer between a number of phases. Drag,...
static const word propertiesName
Default name of the phase properties dictionary.
void dragCorrs(PtrList< volVectorField > &dragCorrs, PtrList< surfaceScalarField > &dragCorrf) const
Set the cell and faces drag correction fields.
PtrList< surfaceScalarField > ddtCorrs() const
Return the flux corrections for the cell-based algorithm. These.
momentumTransferSystem(const phaseSystem &)
Construct from a phase system.
PtrList< surfaceScalarField > Ffs() const
As Fs, but for the face-based algorithm.
PtrList< surfaceScalarField > Fs() const
Return the explicit force fluxes for the cell-based algorithm, that.
virtual ~momentumTransferSystem()
Destructor.
PtrList< PtrList< surfaceScalarField > > invADVfs(const PtrList< surfaceScalarField > &Afs, PtrList< surfaceScalarField > &HVmfs) const
Return the inverse of the central + drag + virtual mass.
virtual tmp< surfaceScalarField > alphaDByAf(const PtrList< volScalarField > &rAs) const
Return the phase diffusivity.
virtual bool read()
Read base phaseProperties dictionary.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
virtual const autoPtr< surfaceVectorField > & Uf() const =0
Return the face velocity.
const dimensionedScalar & residualAlpha() const
Return the residual phase-fraction for given phase.
virtual tmp< fvVectorMatrix > DUDt() const =0
Return the substantive acceleration matrix.
virtual tmp< surfaceScalarField > phi() const =0
Return the volumetric flux.
label index() const
Return the index of the phase.
virtual tmp< volVectorField > U() const =0
Return the velocity.
virtual tmp< fvVectorMatrix > UgradU() const =0
Return the velocity transport matrix.
const word & name() const
Return the name of this phase.
virtual tmp< surfaceScalarField > pPrimef() const =0
Return the face-phase-pressure'.
virtual const volScalarField & rho() const =0
Return the density field.
Class to represent a system of phases.
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
virtual bool read()
Read object.
virtual const dictionary & dict() const
Return the solution dictionary.
A class for managing temporary objects.
bool valid() const
Is this temporary object valid,.
bool isTmp() const
Return true if this is really a temporary object.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
pimpleControl pimple(mesh)
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
Reconstruct volField from a face flux field.
Calculate the snGrad of the given volField.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for implicit and explicit sources.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
tmp< SurfaceField< typename innerProduct< vector, Type >::type > > flux(const VolField< Type > &vf)
Return the face-flux field obtained from the given volVectorField.
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< typename outerProduct< vector, Type >::type > > reconstruct(const SurfaceField< Type > &ssf)
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
tmp< SurfaceField< typename Foam::flux< Type >::type > > ddtCorr(const VolField< Type > &U, const SurfaceField< Type > &Uf)
static const coefficient D("D", dimTemperature, 257.14)
List< word > wordList
A List of words.
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 HashTable< dimensionSet > & dimensions()
Get the table of dimension sets.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void addField(const label phasei, const word &name, tmp< GeoField > field, PtrList< GeoField > &fieldList)
void LUBacksubstitute(const scalarSquareMatrix &luMmatrix, const labelList &pivotIndices, List< Type > &source)
LU back-substitution with given source, returning the solution.
const dimensionSet dimless
void LUDecompose(scalarSquareMatrix &matrix, labelList &pivotIndices)
LU decompose the matrix with pivoting.
tmp< volScalarField > byDt(const volScalarField &vf)
Foam::HashPtrTable< ModelType, Foam::phaseInterfaceKey, Foam::phaseInterfaceKey::hash > generateBlendedInterfacialModels(const phaseSystem &fluid, const dictionary &dict, const wordHashSet &ignoreKeys, const bool ignoreNonModelPhaseInterfaceTypes, const Args &... args)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)