28 #include "surfaceInterpolate.H"
62 calculatedFvPatchScalarField::typeName
86 forAll(movingPhaseModels_, movingPhasei)
89 movingPhaseModels_[movingPhasei]
90 *movingPhaseModels_[movingPhasei].U();
93 forAll(movingPhaseModels_, movingPhasei)
95 movingPhaseModels_[movingPhasei].URef() += dUm;
110 forAll(movingPhaseModels_, movingPhasei)
113 alphafs[movingPhaseModels_[movingPhasei].index()]
114 *movingPhaseModels_[movingPhasei].phi();
117 forAll(movingPhaseModels_, movingPhasei)
119 movingPhaseModels_[movingPhasei].phiRef() += dphim;
146 return gradAlphaf/(
mag(gradAlphaf) + deltaN_);
157 return nHatfv(alpha1, alpha2) & mesh_.Sf();
173 phase1.
U()().boundaryField(),
175 tnHatfv.
ref().boundaryFieldRef()
179 return -
fvc::div(tnHatfv & mesh_.Sf());
195 mesh.time().constant(),
208 referencePhaseName_(lookupOrDefault(
"referencePhase",
word::null)),
247 label movingPhasei = 0;
248 label stationaryPhasei = 0;
249 label anisothermalPhasei = 0;
250 label multicomponentPhasei = 0;
257 multicomponentPhasei += !phase.
pure();
265 stationaryPhasei = 0;
266 anisothermalPhasei = 0;
267 multicomponentPhasei = 0;
300 if (this->
found(
"interfaceCompression"))
350 label movingPhasei=1;
351 movingPhasei<movingPhaseModels_.size();
356 movingPhaseModels_[movingPhasei]
357 *movingPhaseModels_[movingPhasei].rho();
360 if (stationaryPhaseModels_.empty())
366 return rho/sumAlphaMoving();
377 label movingPhasei=1;
378 movingPhasei<movingPhaseModels_.size();
383 movingPhaseModels_[movingPhasei]
384 *movingPhaseModels_[movingPhasei].U();
387 if (stationaryPhaseModels_.empty())
393 return U/sumAlphaMoving();
401 if (interfaceSurfaceTensionModels_.found(key))
403 return interfaceSurfaceTensionModels_[key]->sigma();
409 interfaceSurfaceTensionModel::typeName +
":sigma",
420 if (interfaceSurfaceTensionModels_.found(key))
422 return interfaceSurfaceTensionModels_[key]->sigma(
patchi);
452 pos0(phases()[phasei] - 0.01)*
pos0(0.99 - phases()[phasei])
488 forAll(phaseModels_, phasei)
490 if (!phaseModels_[phasei].incompressible())
531 if (&phase2 != &phase1)
535 if (cAlphas_.found(interface))
537 tSurfaceTension.
ref() +=
547 return tSurfaceTension;
553 forAll(phaseModels_, phasei)
555 phaseModels_[phasei].correct();
564 forAll(movingPhaseModels_, movingPhasei)
566 phaseModel& phase = movingPhaseModels_[movingPhasei];
587 source += dmdts[phase.
index()];
597 bool updateDpdt =
false;
599 forAll(phaseModels_, phasei)
601 phaseModels_[phasei].correctKinematics();
604 if (!updateDpdt && phaseModels_[phasei].
thermo().dpdt())
615 forAll(phaseModels_, phasei)
617 phaseModels_[phasei].correctThermo();
624 forAll(phaseModels_, phasei)
626 phaseModels_[phasei].correctReactions();
633 forAll(phaseModels_, phasei)
635 phaseModels_[phasei].correctSpecies();
642 forAll(phaseModels_, phasei)
644 phaseModels_[phasei].predictMomentumTransport();
651 forAll(phaseModels_, phasei)
653 phaseModels_[phasei].predictThermophysicalTransport();
660 forAll(phaseModels_, phasei)
662 phaseModels_[phasei].correctMomentumTransport();
669 forAll(phaseModels_, phasei)
671 phaseModels_[phasei].correctThermophysicalTransport();
678 if (mesh_.changing())
692 forAll(movingPhaseModels_, movingPhasei)
694 phaseModel& phase = movingPhaseModels_[movingPhasei];
701 MRF_.relative(mesh_.Sf().boundaryField() & UBf)
710 isA<fixedValueFvsPatchScalarField>(phiBf[
patchi])
711 && !isA<movingWallVelocityFvPatchVectorField>(UBf[
patchi])
730 forAll(movingPhaseModels_, movingPhasei)
732 phaseModel& phase = movingPhaseModels_[movingPhasei];
734 MRF_.makeRelative(phase.
phiRef());
738 forAll(movingPhaseModels_, movingPhasei)
740 phaseModel& phase = movingPhaseModels_[movingPhasei];
747 if (Ubf[
patchi].fixesValue())
749 Ubf[
patchi].initEvaluate();
755 if (Ubf[
patchi].fixesValue())
764 correctBoundaryFlux();
768 forAll(movingPhaseModels_, movingPhasei)
770 phaseModel& phase = movingPhaseModels_[movingPhasei];
778 phi_ += alphafs[phasei]*(mesh_.Sf() & phase.
UfRef());
781 if (incompressible())
786 movingPhaseModels_[0].
U(),
826 MRF_.makeRelative(phi_);
829 setMixturePhi(alphafs, phi_);
839 forAll(phaseModels_, phasei)
841 readOK &= phaseModels_[phasei].read();
863 return vf/vf.
mesh().time().deltaT();
876 return sf/
sf.
mesh().time().deltaT();
#define forAll(list, i)
Loop across all elements in list.
const Mesh & mesh() const
Return mesh.
Generic GeometricBoundaryField class.
void evaluate()
Evaluate boundary conditions.
Generic GeometricField class.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
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...
writeOption writeOpt() const
const word & name() const
Return name.
static word groupName(Name name, const word &group)
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.
bool set(const label) const
Is element set.
label size() const
Return the number of elements in the UPtrList.
void resize(const label)
Reset size of UPtrList. This can only be used to set the size.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Dimension set for the base types.
Base-class for fluid thermodynamic properties.
virtual const volScalarField & psi() const =0
Compressibility [s^2/m^2].
Mesh data needed to do the Finite Volume discretisation.
const fvSchemes & schemes() const
Return the fvSchemes.
tmp< fvMatrix< Type > > source(const VolField< Type > &field) const
Return source for an equation.
void setFluxRequired(const word &name) const
static const surfaceScalarField & localRDeltaTf(const fvMesh &mesh)
Return the reciprocal of the local face time-step.
static const volScalarField & localRDeltaT(const fvMesh &mesh)
Return the reciprocal of the local time-step.
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
static const dimensionSet dimSigma
Coefficient dimensions.
Non-orthogonal solution control class. Provides non-orthogonal-loop control methods.
Word-pair based class used for keying interface models in hash tables.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
virtual bool pure() const =0
Return whether the phase is pure (i.e., not multi-component)
virtual surfaceScalarField & phiRef()=0
Access the volumetric flux.
virtual bool stationary() const =0
Return whether the phase is stationary.
virtual const rhoFluidThermo & fluidThermo() const =0
Return the thermophysical model.
label index() const
Return the index of the phase.
virtual tmp< volVectorField > U() const =0
Return the velocity.
virtual bool isothermal() const =0
Return whether the phase is isothermal.
virtual volVectorField & URef()=0
Access the velocity.
const word & name() const
Return the name of this phase.
virtual const volScalarField & rho() const =0
Return the density field.
virtual void correctContinuityError(const volScalarField &source)
Correct the continuity error.
virtual surfaceVectorField & UfRef()=0
Access the face velocity.
Class to represent a system of phases and model interfacial transfers between them.
phaseModelPartialList stationaryPhaseModels_
Stationary phase models.
virtual void correctKinematics()
Correct the kinematics.
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
void correctPhi(const volScalarField &p_rgh, const autoPtr< volScalarField > &divU, const pressureReference &pressureReference, nonOrthogonalSolutionControl &pimple)
static const word propertiesName
Default name of the phase properties dictionary.
void generateInterfacialModels(const dictionary &dict, const phaseInterface &interface, PtrList< phaseInterface > &interfaces, PtrList< ModelType > &models) const
Generate interfacial-model lists.
virtual void correctReactions()
Correct the reactions.
const fvMesh & mesh_
Reference to the mesh.
phaseModelPartialList multicomponentPhaseModels_
Multi-component phase models.
phaseModelList phaseModels_
Phase models.
phaseModelPartialList movingPhaseModels_
Moving phase models.
void setMixtureU(const volVectorField &Um)
Re-normalise the velocity of the phases.
virtual void correctSpecies()
Correct the species mass fractions.
virtual void correctThermo()
Correct the thermodynamics.
virtual void correct()
Correct the fluid properties other than those listed below.
tmp< volScalarField > sigma(const phaseInterfaceKey &key) const
Return the surface tension coefficient for an interface.
phaseModelPartialList anisothermalPhaseModels_
Anisothermal phase models.
virtual void predictThermophysicalTransport()
Predict the energy transport e.g. alphat.
tmp< volScalarField > K(const phaseModel &alpha1, const phaseModel &alpha2) const
Curvature of interface between two phases.
tmp< volVectorField > U() const
Return the mixture velocity.
virtual void correctMomentumTransport()
Correct the momentumTransport.
void correctBoundaryFlux()
Correct fixed-flux BCs to be consistent with the velocity BCs.
const phaseModelList & phases() const
Return the phase models.
virtual tmp< volScalarField > dmdtf(const phaseInterfaceKey &key) const
Return the mass transfer rate for an interface.
interfaceSurfaceTensionModelTable interfaceSurfaceTensionModels_
Surface tension models.
virtual void correctThermophysicalTransport()
Correct the energy transport e.g. alphat.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
virtual void meshUpdate()
Update the fluid properties for mesh changes.
cAlphaTable cAlphas_
Interface compression coefficients.
surfaceScalarField phi_
Total volumetric flux.
virtual bool implicitPhasePressure() const
Returns true if the phase pressure is treated implicitly.
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
Return the surface tension force.
tmp< volScalarField > sumAlphaMoving() const
Return the sum of the phase fractions of the moving phases.
phaseSystem(const fvMesh &mesh)
Construct from fvMesh.
void setMixturePhi(const PtrList< surfaceScalarField > &alphafs, const surfaceScalarField &phim)
Re-normalise the flux of the phases.
virtual ~phaseSystem()
Destructor.
void generateInterfacialValues(const dictionary &dict, HashTable< ValueType, phaseInterfaceKey, phaseInterfaceKey::hash > &values) const
Generate interfacial-model tables.
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
Normal to interface between two phases dotted with face areas.
tmp< volScalarField > rho() const
Return the mixture density.
word referencePhaseName_
Name of optional reference phase which is not solved for.
tmp< surfaceVectorField > nHatfv(const volScalarField &alpha1, const volScalarField &alpha2) const
Normal to interface between two phases.
virtual void predictMomentumTransport()
Predict the momentumTransport.
virtual PtrList< volScalarField > d2mdtdps() const
Return the mass transfer pressure implicit coefficients.
virtual bool read()
Read base phaseProperties dictionary.
virtual void correctContinuityError()
Correct the continuity errors.
bool incompressible() const
Return incompressibility.
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
Provides controls for the pressure reference in closed-volume simulations.
virtual bool read()
Read object.
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.
static const word null
An empty word.
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
pimpleControl pimple(mesh)
Flux correction functions to ensure continuity.
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the gradient of the given field.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
Calculate the snGrad of the given volField.
volScalarField sf(fieldObject, mesh)
const volScalarField & psi
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
void correctPhi(surfaceScalarField &phi, const volVectorField &U, const volScalarField &p, const autoPtr< volScalarField > &rAU, const autoPtr< volScalarField > &divU, const pressureReference &pressureReference, nonOrthogonalSolutionControl &pcorrControl)
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 > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
void makeRelative(surfaceScalarField &phi, const volVectorField &U)
Make the given flux relative.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
dimensionedScalar pos0(const dimensionedScalar &ds)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
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 dimPressure
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimVolumetricFlux
const dimensionSet dimless
SurfaceField< scalar > surfaceScalarField
tmp< volScalarField > byDt(const volScalarField &vf)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionSet dimTime
void correctContactAngle(const volScalarField &alpha1, const volScalarField &alpha2, const volVectorField::Boundary &Ubf, const dimensionedScalar &deltaN, surfaceVectorField::Boundary &nHatbf)
Correct the contact angle for the two volume fraction fields.
const dimensionSet dimDensity
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fluidMulticomponentThermo & thermo