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 = "
267 Uw_.correctBoundaryConditions();
321 U_.correctBoundaryConditions();
416kinematicSingleLayer::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;
828 pSpPrimary_.boundaryFieldRef()[patchi][facei] -= pressureSource;
881 for (
int corr=1; corr<=
nCorr_; corr++)
1047 scalar addedMassTotal = 0.0;
1054 Info<<
indent <<
"added mass = " << addedMassTotal <<
nl
1055 <<
indent <<
"current mass = "
1057 <<
indent <<
"min/max(mag(U)) = "
1058 << limits_U.
min() <<
", "
1059 << limits_U.
max() <<
nl
1060 <<
indent <<
"min/max(delta) = "
1061 << limits_delta.
min() <<
", "
1062 << limits_delta.
max() <<
nl
1063 <<
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
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const uniformDimensionedVectorField & g
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())
static const this_type & null() noexcept
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place).
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
void correctBoundaryConditions()
Correct boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
A min/max value pair with additional methods. In addition to conveniently storing values,...
const T & max() const noexcept
The max value.
const T & min() const noexcept
The min value.
scalar deltaTValue() const noexcept
Return time step value.
dimensionedScalar deltaT() const
Return time step.
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
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,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
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...
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
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.
Mesh data needed to do the Finite Volume discretisation.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
Template invariant parts for fvPatchField.
const polyBoundaryMesh & boundaryMesh() const noexcept
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 writeOnProc=true) const
Write using setting from DB.
const Time & time_
Reference to the time database.
const dictionary & solution() const
Return the solution dictionary.
const Time & time() const noexcept
Return the reference to the time database.
dictionary coeffs_
Model coefficients dictionary.
const fvMesh & regionMesh() const
Return the region mesh database.
virtual void preEvolveRegion()
Pre-evolve region.
const fvMesh & primaryMesh() const noexcept
Return the reference to the primary 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.
wordList mappedFieldAndInternalPatchTypes() const
Return boundary types for mapped field patches.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
virtual const volVectorField & nHat() const
Return the patch normal vectors.
wordList mappedPushedFieldPatchTypes() const
Return boundary types for pushed mapped field patches.
static autoPtr< surfaceFilmModel > New(const fvMesh &mesh, const dimensionedVector &g, const word ®ionType="surfaceFilm")
Return a reference to the selected surface film model.
Base class for film thermo models.
Base class for film turbulence models.
tmp< fvVectorMatrix > correct(volVectorField &U)
Return (net) force system.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
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.
const dimensionedVector & g() const
Return the acceleration due to gravity.
virtual bool read()
Read control parameters from dictionary.
virtual void correct(scalarField &availableMass, volScalarField &massToTransfer)
Correct kinematic transfers.
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable).
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)"))
Namespace for handling debugging switches.
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
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
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.
Type gWeightedAverage(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted average of a field, using the mag() of the weights.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
fvMatrix< scalar > fvScalarMatrix
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Type gWeightedSum(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted sum (integral) of a field, using the mag() of the weights.
scalarMinMax gMinMaxMag(const FieldField< Field, Type > &f)
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
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)
fvMatrix< vector > fvVectorMatrix
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimDensity
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
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.