46 namespace regionModels
48 namespace surfaceFilmModels
125 rhoSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
126 USpPrimaryBf[patchi] *= rpriMagSfdeltaT;
127 pSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
139 if (
time().writeTime())
148 scalar addedMassTotal = 0.0;
234 <<
"Surface film: " <<
type() <<
nl 235 <<
" time step continuity errors: sum local = " 416 kinematicSingleLayer::kinematicSingleLayer
418 const word& modelType,
421 const word& regionType,
427 momentumPredictor_(
solution().subDict(
"PISO").
lookup(
"momentumPredictor")),
428 nOuterCorr_(
solution().subDict(
"PISO").getOrDefault(
"nOuterCorr", 1)),
429 nCorr_(
solution().subDict(
"PISO").
get<label>(
"nCorr")),
432 solution().subDict(
"PISO").
get<label>(
"nNonOrthCorr")
435 cumulativeContErr_(0.0),
437 deltaSmall_(
"deltaSmall",
dimLength, SMALL),
438 deltaCoLimit_(
solution().getOrDefault<scalar>(
"deltaCoLimit", 1
e-4)),
608 "cloudDiameterTrans",
631 this->mappedPushedFieldPatchTypes<
vector>()
645 this->mappedPushedFieldPatchTypes<scalar>()
659 this->mappedPushedFieldPatchTypes<scalar>()
714 this->mappedFieldAndInternalPatchTypes<
vector>()
728 this->mappedFieldAndInternalPatchTypes<scalar>()
742 this->mappedFieldAndInternalPatchTypes<scalar>()
756 this->mappedFieldAndInternalPatchTypes<scalar>()
761 availableMass_(regionMesh().nCells(),
Zero),
763 injection_(*this, coeffs_),
765 transfer_(*this, coeffs_),
769 forces_(*this, coeffs_),
814 const scalar massSource,
815 const vector& momentumSource,
816 const scalar pressureSource,
817 const scalar energySource
821 <<
"\nSurface film: " <<
type() <<
": adding to film source:" <<
nl 822 <<
" mass = " << massSource <<
nl 823 <<
" momentum = " << momentumSource <<
nl 824 <<
" pressure = " << pressureSource <<
endl;
881 for (
int corr=1; corr<=
nCorr_; corr++)
1047 scalar addedMassTotal = 0.0;
1051 Info<<
indent <<
"added mass = " << addedMassTotal <<
nl 1052 <<
indent <<
"current mass = " 1054 <<
indent <<
"min/max(mag(U)) = " <<
gMin(
mag(Uinternal)) <<
", " 1056 <<
indent <<
"min/max(delta) = " <<
gMin(deltaInternal) <<
", " 1057 <<
gMax(deltaInternal) <<
nl 1058 <<
indent <<
"coverage = " virtual bool read()
Read control parameters from dictionary.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place)
virtual bool read()
Read control parameters from dictionary.
void size(const label n)
Older name for setAddressableSize.
virtual const volVectorField & U() const
Return the film velocity [m/s].
volVectorField Us_
Velocity - surface [m/s].
virtual void preEvolveRegion()
Pre-evolve film hook.
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
const dimensionedScalar deltaSmall_
Small delta.
const word zeroGradientType
A zeroGradient patch field type.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
Ostream & indent(Ostream &os)
Indent stream.
virtual const volScalarField & deltaRho() const
Return the film thickness*density (helper field) [kg/m3].
scalar deltaTValue() const noexcept
Return time step value.
virtual void continuityCheck()
Continuity check.
Base class for surface film models.
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
volScalarField primaryMassTrans_
Film mass available for transfer to the primary region.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Kinematic form of single-cell layer surface film model.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual ~kinematicSingleLayer()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
Base class for film thermo models.
const word & name() const noexcept
Return the object name.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
constexpr char nl
The newline '\n' character (0x0a)
Reconstruct volField from a face flux field.
volVectorField USp_
Momentum [kg/m/s2].
virtual void transferPrimaryRegionThermoFields()
Transfer thermo fields from the primary region to the film region.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
volScalarField muPrimary_
Viscosity [Pa.s].
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
virtual const volVectorField & Us() const
Return the film surface velocity [m/s].
const dimensionedScalar phi0
Magnetic flux quantum: default SI units: [Wb].
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Template invariant parts for fvPatchField.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual tmp< volScalarField::Internal > Srho() const
Return total mass source - Eulerian phase only.
Calculate the snGrad of the given volField.
scalarField availableMass_
Available mass for transfer via sub-models.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
volScalarField cloudDiameterTrans_
Parcel diameters originating from film to cloud.
scalar addedMassTotal_
Cumulative mass added via sources [kg].
Ignore writing from objectRegistry::writeObject()
volVectorField USpPrimary_
Momentum [kg/m/s2].
const dimensionSet dimless
Dimensionless.
Lookup type of boundary radiation properties.
injectionModelList injection_
Cloud injection.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual void info(Ostream &os)
Provide some info.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
virtual tmp< volScalarField > primaryMassTrans() const
Return mass transfer source - Eulerian phase only.
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
virtual void evolveRegion()
Evolve the film equations.
Macros for easy insertion into run-time selection tables.
virtual void solveContinuity()
Solve continuity equation.
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable)
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
virtual tmp< volScalarField > pp()
Implicit pressure source coefficient.
tmp< fvVectorMatrix > correct(volVectorField &U)
Return (net) force system.
volScalarField deltaRho_
Film thickness*density (helper field) [kg/m2].
volScalarField sigma_
Surface tension [m/s2].
#define forAll(list, i)
Loop across all elements in list.
volScalarField rho_
Density [kg/m3].
virtual void transferPrimaryRegionSourceFields()
Transfer source fields from the primary region to the film region.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
Switch momentumPredictor_
Momentum predictor.
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
dimensionedScalar pos(const dimensionedScalar &ds)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionSet dimVolume(pow3(dimLength))
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Base class for film turbulence models.
const dimensionedScalar e
Elementary charge.
virtual void info()
Provide some feedback.
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
virtual tmp< fvVectorMatrix > solveMomentum(const volScalarField &pu, const volScalarField &pp)
Solve for film velocity.
virtual const volScalarField & cloudMassTrans() const
Return the film mass available for transfer to cloud.
virtual void preEvolveRegion()
Pre-evolve region.
tmp< volVectorField > gTan() const
Return the gravity tangential component contributions.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
tmp< volScalarField > mass() const
Return the current film mass.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
virtual const volScalarField & cloudDiameterTrans() const
Return the parcel diameters originating from film to cloud.
Calculate the face-flux of the given field.
#define DebugInFunction
Report an information message using Foam::Info.
Calculate the laplacian of the given field.
tmp< volScalarField > gNormClipped() const
Return the gravity normal-to-patch component contribution.
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
forceList forces_
List of film forces.
const dictionary & solution() const
Return the solution dictionary.
volScalarField pPrimary_
Pressure [Pa].
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
volVectorField U_
Velocity - mean [m/s].
Reading is optional [identical to LAZY_READ].
virtual const volVectorField & nHat() const
Return the patch normal vectors.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual const surfaceScalarField & phi() const
Return the film flux [kg.m/s].
const fvMesh & regionMesh() const
Return the region mesh database.
static const GeometricField< scalar, fvPatchField, volMesh > & null() noexcept
Return a null GeometricField (reference to a nullObject).
Volume integrate volField creating a volField.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
volScalarField pSpPrimary_
Pressure [Pa].
volScalarField delta_
Film thickness [m].
const dimensionSet dimPressure
label nNonOrthCorr_
Number of non-orthogonal correctors.
volScalarField pSp_
Pressure [Pa].
errorManip< error > abort(error &err)
virtual const volScalarField & kappa() const
Return the film thermal conductivity [W/m/K].
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
Calculate the divergence of the given field.
dimensionedScalar totalMass
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
volScalarField rhoPrimary_
Density [kg/m3].
const uniformDimensionedVectorField & g
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual void info(Ostream &os)
Provide some info.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
volVectorField Uw_
Velocity - wall [m/s].
int debug
Static debugging option.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
label nCorr_
Number of PISO-like correctors.
Type gMax(const FieldField< Field, Type > &f)
virtual void correctAlpha()
Correct film coverage field.
virtual const volScalarField & hs() const
Return the film surface enthalpy [J/kg].
virtual void resetPrimaryRegionSourceTerms()
Reset source term fields.
scalar cumulativeContErr_
Cumulative continuity error.
const dimensionSet dimEnergy
transferModelList transfer_
Transfer with the continuous phase.
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.
const dimensionSet dimDensity
volVectorField UPrimary_
Velocity [m/s].
virtual void updateSubmodels()
Update the film sub-models.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
volScalarField mu_
Dynamic viscosity [Pa.s].
virtual const volVectorField & Uw() const
Return the film wall velocity [m/s].
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const Time & time_
Reference to the time database.
surfaceScalarField phi_
Mass flux (includes film thickness) [kg.m/s].
Mesh data needed to do the Finite Volume discretisation.
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
A List with indirect addressing. Like IndirectList but does not store addressing. ...
virtual void updateSurfaceVelocities()
Update film surface velocities.
virtual const volScalarField & Tw() const
Return the film wall temperature [K].
label nOuterCorr_
Number of outer correctors.
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
volScalarField rhoSpPrimary_
Mass [kg/m2/s].
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
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.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
Selector class for relaxation factors, solver type and solution.
virtual const volScalarField & rho() const
Return the film density [kg/m3].
volScalarField cloudMassTrans_
Film mass available for transfer to cloud.
void constrainFilmField(Type &field, const typename Type::cmptType &value)
Constrain a film region master/slave boundaries of a field to a.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const fvMesh & primaryMesh() const noexcept
Return the reference to the primary mesh database.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
A class for managing temporary objects.
virtual const volScalarField & Cp() const
Return the film specific heat capacity [J/kg/K].
A patch is a list of labels that address the faces in the global face list.
volScalarField rhoSp_
Mass [kg/m2/s].
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual const volScalarField & T() const
Return the film mean temperature [K].
defineTypeNameAndDebug(kinematicSingleLayer, 0)
virtual tmp< volScalarField::Internal > Sh() const
Return enthalpy source - Eulerian phase only.
virtual void solveThickness(const volScalarField &pu, const volScalarField &pp, fvVectorMatrix &UEqn)
Solve coupled velocity-thickness equations.
virtual void postEvolveRegion()
Post-evolve film hook.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual scalar CourantNumber() const
Courant number evaluation.
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))
Do not request registration (bool: false)
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
dimensionedScalar deltaT() const
Return time step.
scalar deltaCoLimit_
Film thickness above which Courant number calculation in valid.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const Time & time() const noexcept
Return the reference to the time database.
const dimensionSet dimArea(sqr(dimLength))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
virtual void correctThermoFields()
Correct the thermo fields.
const dimensionSet & dimensions() const noexcept
Return dimensions.
#define InfoInFunction
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity