48namespace surfaceFilmModels
130 rhoSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
131 USpPrimaryBf[patchi] *= rpriMagSfdeltaT;
132 pSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
144 if (
time().writeTime())
153 scalar addedMassTotal = 0.0;
253 <<
"Surface film: " <<
type() <<
nl
254 <<
" time step continuity errors: sum local = "
437 const word& modelType,
440 const word& regionType,
446 momentumPredictor_(
solution().subDict(
"PISO").
lookup(
"momentumPredictor")),
447 nOuterCorr_(
solution().subDict(
"PISO").getOrDefault(
"nOuterCorr", 1)),
448 nCorr_(
solution().subDict(
"PISO").get<label>(
"nCorr")),
451 solution().subDict(
"PISO").get<label>(
"nNonOrthCorr")
454 cumulativeContErr_(0.0),
456 deltaSmall_(
"deltaSmall",
dimLength, SMALL),
457 deltaCoLimit_(
solution().getOrDefault<scalar>(
"deltaCoLimit", 1
e-4)),
471 zeroGradientFvPatchScalarField::typeName
485 zeroGradientFvPatchScalarField::typeName
499 zeroGradientFvPatchScalarField::typeName
526 zeroGradientFvPatchScalarField::typeName
551 zeroGradientFvPatchScalarField::typeName
564 zeroGradientFvPatchScalarField::typeName
578 zeroGradientFvPatchScalarField::typeName
607 zeroGradientFvPatchScalarField::typeName
621 zeroGradientFvPatchScalarField::typeName
627 "cloudDiameterTrans",
635 zeroGradientFvPatchScalarField::typeName
650 this->mappedPushedFieldPatchTypes<
vector>()
664 this->mappedPushedFieldPatchTypes<scalar>()
678 this->mappedPushedFieldPatchTypes<scalar>()
733 this->mappedFieldAndInternalPatchTypes<
vector>()
747 this->mappedFieldAndInternalPatchTypes<scalar>()
761 this->mappedFieldAndInternalPatchTypes<scalar>()
775 this->mappedFieldAndInternalPatchTypes<scalar>()
780 availableMass_(regionMesh().nCells(),
Zero),
782 injection_(*this, coeffs_),
784 transfer_(*this, coeffs_),
788 forces_(*this, coeffs_),
833 const scalar massSource,
834 const vector& momentumSource,
835 const scalar pressureSource,
836 const scalar energySource
840 <<
"\nSurface film: " <<
type() <<
": adding to film source:" <<
nl
841 <<
" mass = " << massSource <<
nl
842 <<
" momentum = " << momentumSource <<
nl
843 <<
" pressure = " << pressureSource <<
endl;
900 for (
int corr=1; corr<=
nCorr_; corr++)
1066 scalar addedMassTotal = 0.0;
1070 Info<<
indent <<
"added mass = " << addedMassTotal <<
nl
1071 <<
indent <<
"current mass = "
1073 <<
indent <<
"min/max(mag(U)) = " <<
gMin(
mag(Uinternal)) <<
", "
1075 <<
indent <<
"min/max(delta) = " <<
gMin(deltaInternal) <<
", "
1076 <<
gMax(deltaInternal) <<
nl
1077 <<
indent <<
"coverage = "
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
dimensionedScalar totalMass
const uniformDimensionedVectorField & g
const dimensionSet & dimensions() const
Return dimensions.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static const GeometricField< scalar, fvPatchField, volMesh > & null()
Return a null geometric field.
void correctBoundaryConditions()
Correct boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
scalar deltaTValue() const noexcept
Return time step value.
dimensionedScalar deltaT() const
Return time step.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
tmp< volScalarField > A() const
Return the central coefficient.
tmp< GeometricField< Type, fvPatchField, volMesh > > H() const
Return the H operation source.
Mesh data needed to do the Finite Volume discretisation.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
Lookup type of boundary radiation properties.
virtual bool write(const bool valid=true) const
Write using setting from DB.
virtual void preEvolveRegion()
Pre-evolve thermal baffle.
tmp< faVectorMatrix > correct(areaVectorField &U)
Return (net) force system.
virtual void info(Ostream &os)
Provide some info.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
const Time & time_
Reference to the time database.
const Time & time() const
Return the reference to the time database.
const dictionary & solution() const
Return the solution dictionary.
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
const fvMesh & regionMesh() const
Return the region mesh database.
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
virtual const volVectorField & nHat() const
Return the patch normal vectors.
Base class for film thermo models.
Base class for film turbulence models.
Kinematic form of single-cell layer surface film model.
tmp< volScalarField > gNormClipped() const
Return the gravity normal-to-patch component contribution.
virtual void solveThickness(const volScalarField &pu, const volScalarField &pp, fvVectorMatrix &UEqn)
Solve coupled velocity-thickness equations.
volScalarField rho_
Density [kg/m3].
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
virtual const volVectorField & U() const
Return the film velocity [m/s].
virtual void continuityCheck()
Continuity check.
scalar addedMassTotal_
Cumulative mass added via sources [kg].
volVectorField USpPrimary_
Momentum [kg/m/s2].
volVectorField U_
Velocity - mean [m/s].
virtual void solveContinuity()
Solve continuity equation.
virtual const volScalarField & hs() const
Return the film surface enthalpy [J/kg].
tmp< volVectorField > gTan() const
Return the gravity tangential component contributions.
virtual void postEvolveRegion()
Post-evolve film hook.
virtual const volScalarField & rho() const
Return the film density [kg/m3].
scalar cumulativeContErr_
Cumulative continuity error.
forceList forces_
List of film forces.
volScalarField sigma_
Surface tension [m/s2].
virtual void updateSurfaceVelocities()
Update film surface velocities.
tmp< volScalarField > mass() const
Return the current film mass.
virtual const volScalarField & cloudDiameterTrans() const
Return the parcel diameters originating from film to cloud.
volVectorField USp_
Momentum [kg/m/s2].
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
virtual void addSources(const label patchi, const label facei, const scalar massSource, const vector &momentumSource, const scalar pressureSource, const scalar energySource=0)
External hook to add sources to the film.
virtual const volVectorField & Us() const
Return the film surface velocity [m/s].
volScalarField rhoPrimary_
Density [kg/m3].
virtual const surfaceScalarField & phi() const
Return the film flux [kg.m/s].
virtual const volScalarField & T() const
Return the film mean temperature [K].
virtual const volScalarField & deltaRho() const
Return the film thickness*density (helper field) [kg/m3].
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
volScalarField pPrimary_
Pressure [Pa].
volVectorField Us_
Velocity - surface [m/s].
injectionModelList injection_
Cloud injection.
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
volScalarField rhoSp_
Mass [kg/m2/s].
volScalarField deltaRho_
Film thickness*density (helper field) [kg/m2].
volVectorField Uw_
Velocity - wall [m/s].
const dimensionedScalar deltaSmall_
Small delta.
Switch momentumPredictor_
Momentum predictor.
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
volScalarField pSpPrimary_
Pressure [Pa].
transferModelList transfer_
Transfer with the continuous phase.
virtual ~kinematicSingleLayer()
Destructor.
volScalarField delta_
Film thickness [m].
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
label nOuterCorr_
Number of outer correctors.
virtual void preEvolveRegion()
Pre-evolve film hook.
virtual void correctAlpha()
Correct film coverage field.
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
volScalarField muPrimary_
Viscosity [Pa.s].
volScalarField rhoSpPrimary_
Mass [kg/m2/s].
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
label nCorr_
Number of PISO-like correctors.
volVectorField UPrimary_
Velocity [m/s].
scalar deltaCoLimit_
Film thickness above which Courant number calculation in valid.
virtual void correctThermoFields()
Correct the thermo fields.
virtual const volScalarField & cloudMassTrans() const
Return the film mass available for transfer to cloud.
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
virtual void info()
Provide some feedback.
virtual void updateSubmodels()
Update the film sub-models.
volScalarField mu_
Dynamic viscosity [Pa.s].
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
volScalarField primaryMassTrans_
Film mass available for transfer to the primary region.
volScalarField pSp_
Pressure [Pa].
void constrainFilmField(Type &field, const typename Type::cmptType &value)
Constrain a film region master/slave boundaries of a field to a.
virtual scalar CourantNumber() const
Courant number evaluation.
volScalarField cloudMassTrans_
Film mass available for transfer to cloud.
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
label nNonOrthCorr_
Number of non-orthogonal correctors.
virtual const volVectorField & Uw() const
Return the film wall velocity [m/s].
scalarField availableMass_
Available mass for transfer via sub-models.
virtual tmp< volScalarField::Internal > Srho() const
Return total mass source - Eulerian phase only.
virtual tmp< volScalarField > primaryMassTrans() const
Return mass transfer source - Eulerian phase only.
virtual bool read()
Read control parameters from dictionary.
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
virtual tmp< volScalarField::Internal > Sh() const
Return enthalpy source - Eulerian phase only.
virtual void evolveRegion()
Evolve the film equations.
Base class for surface film models.
virtual bool read()
Read control parameters from dictionary.
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
virtual void info(Ostream &os)
Provide some info.
void setFluxRequired(const word &name) const
Get flux-required for given name, or default.
Selector class for relaxation factors, solver type and solution.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Calculate the laplacian of the given field.
Reconstruct volField from a face flux field.
Calculate the snGrad of the given volField.
Volume integrate volField creating a volField.
#define DebugInFunction
Report an information message using Foam::Info.
#define InfoInFunction
Report an information message using Foam::Info.
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
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.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
const dimensionSet dimPressure
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
messageStream Info
Information stream (stdout output on master, null elsewhere)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
errorManip< error > abort(error &err)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Type gMin(const FieldField< Field, Type > &f)
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
const dimensionSet dimDensity
Type gMax(const FieldField< Field, Type > &f)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.