27 #include "surfaceInterpolate.H"
52 Foam::fv::interfaceTurbulenceDamping::interfaceFraction
59 tmp<volScalarField::Internal> tA
89 const scalar nSf(
mag(
n[own[facei]] & Sf[facei]));
90 A[own[facei]] += nSf*(ialphaf[facei] - ialpha[own[facei]]);
91 sumnSf[own[facei]] += nSf;
94 const scalar nSf(
mag(
n[nei[facei]] & Sf[facei]));
95 A[nei[facei]] += nSf*(ialphaf[facei] - ialpha[nei[facei]]);
96 sumnSf[nei[facei]] += nSf;
108 const scalar nSf(
mag(
n[own[facei]] & pSf[facei]));
109 A[own[facei]] += nSf*(palphaf[facei] - ialpha[own[facei]]);
110 sumnSf[own[facei]] += nSf;
117 if (sumnSf[i] > small)
119 a[i] = 2*
mag(a[i])/sumnSf[i];
131 template<
class RhoType>
132 void Foam::fv::interfaceTurbulenceDamping::addRhoSup
136 fvMatrix<scalar>& eqn
141 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
145 phase_.fluid().movingPhases();
149 movingPhases[0]*
sqr(movingPhases[0].fluidThermo().nu()()())
152 for (
label phasei=1; phasei<movingPhases.size(); phasei++)
156 *
sqr(movingPhases[phasei].fluidThermo().nu()()());
159 if (field.name() ==
"epsilon")
161 eqn +=
rho*interfaceFraction(phase_)*C2_*aSqrnu*turbulence_.k()()
164 else if (field.name() ==
"omega")
166 eqn +=
rho*interfaceFraction(phase_)*beta_*aSqrnu
167 /(
sqr(betaStar_)*
pow4(delta_));
172 <<
"Support for field " << field.name() <<
" is not implemented"
182 const word& sourceName,
183 const word& modelType,
208 fieldName_ = epsilonName;
212 fieldName_ = omegaName;
217 <<
"Cannot find either " << epsilonName <<
" or " << omegaName
237 addRhoSup(
one(), field, eqn);
248 addRhoSup(
rho(), field, eqn);
267 alpha*
sqr(phase_.fluidThermo().nu()()())
272 eqn +=
rho()*interfaceFraction(
alpha)
273 *C2_*aSqrnu*turbulence_.k()()/
pow4(delta_);
277 eqn +=
rho()*interfaceFraction(
alpha)
278 *beta_*aSqrnu/(
sqr(betaStar_)*
pow4(delta_));
283 <<
"Support for field " << field.
name() <<
" is not implemented"
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const GeoMesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
Generic GeometricField class.
DimensionedField< Type, GeoMesh, PrimitiveField > Internal
Type of the internal field from which this GeometricField is derived.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
static word groupName(Name name, const word &group)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const labelUList & owner() const
Internal face owner.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const surfaceVectorField & Sf() const
Return cell face area vectors.
const labelUList & neighbour() const
Internal face neighbour.
Finite volume model abstract base class.
const fvMesh & mesh() const
Return const access to the mesh database.
Free-surface phase turbulence damping function.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
virtual void addSup(const volScalarField &field, fvMatrix< scalar > &eqn) const
Add source to mixture epsilon or omega equation.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
interfaceTurbulenceDamping(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Abstract base class for momentum transport models (RAS, LES and laminar).
bool foundObject(const word &name) const
Is the named Type in registry.
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
const phaseSystem & fluid() const
Return the system to which this phase belongs.
const dimensionedScalar & deltaN() const
Stabilisation for normalisation of the interface normal.
UPtrList< phaseModel > phaseModelPartialList
Partial list of phase models.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the gradient of the given field.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
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< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
static const coefficient A("A", dimPressure, 611.21)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
const dimensionSet & dimless
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimLength
SurfaceField< scalar > surfaceScalarField
void pow4(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
VolField< scalar > volScalarField
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
SurfaceField< vector > surfaceVectorField
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.