46 namespace regionModels
48 namespace 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 = " 435 kinematicSingleLayer::kinematicSingleLayer
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)),
627 "cloudDiameterTrans",
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 = " 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].
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
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
Get flux-required for given name, or default.
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].
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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))
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 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.
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 tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
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].
virtual tmp< volScalarField > pu()
Explicit pressure source contribution.
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.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
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].
static const GeometricField< scalar, fvPatchField, volMesh > & null()
Return a null geometric field.
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.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
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.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
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)
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