27 #include "surfaceInterpolate.H" 42 interfaceTurbulenceDamping,
52 Foam::fv::interfaceTurbulenceDamping::interfaceFraction
57 const fvMesh& mesh = this->
mesh();
59 tmp<volScalarField::Internal> tA
79 gradAlpha()/(
mag(gradAlpha()) + phase_.fluid().deltaN())
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;
107 const scalar nSf(
mag(
n[own[facei]] & Sf[facei]));
108 A[own[facei]] += nSf*(palphaf[facei] - ialpha[own[facei]]);
109 sumnSf[own[facei]] += nSf;
116 if (sumnSf[i] > small)
118 a[i] = 2*
mag(a[i])/sumnSf[i];
130 template<
class RhoType>
131 void Foam::fv::interfaceTurbulenceDamping::addRhoSup
134 fvMatrix<scalar>& eqn,
135 const word& fieldName
140 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
144 phase_.fluid().movingPhases();
148 movingPhases[0]*
sqr(movingPhases[0].
thermo().nu()()())
157 if (fieldName ==
"epsilon")
159 eqn += rho*interfaceFraction(phase_)*C2_*aSqrnu*turbulence_.k()()
162 else if (fieldName ==
"omega")
164 eqn += rho*interfaceFraction(phase_)*beta_*aSqrnu
165 /(
sqr(betaStar_)*
pow4(delta_));
170 <<
"Support for field " << fieldName <<
" is not implemented" 180 const word& sourceName,
181 const word& modelType,
182 const dictionary& dict,
186 fvModel(sourceName, modelType, dict, mesh),
187 phaseName_(dict.
lookup(
"phase")),
191 mesh.lookupObject<phaseModel>(IOobject::groupName(
"alpha", phaseName_))
205 betaStar_(
"betaStar",
dimless, 0),
213 fieldName_ = epsilonName;
214 C2_.read(turbulence_.coeffDict());
218 fieldName_ = omegaName;
219 betaStar_.read(turbulence_.coeffDict());
222 if (turbulence_.coeffDict().found(
"beta"))
224 beta_.read(turbulence_.coeffDict());
235 <<
"Cannot find either " << epsilonName <<
" or " << omegaName
251 fvMatrix<scalar>& eqn,
252 const word& fieldName
255 addRhoSup(one(), eqn, fieldName);
262 fvMatrix<scalar>& eqn,
263 const word& fieldName
266 addRhoSup(
rho(), eqn, fieldName);
274 fvMatrix<scalar>& eqn,
275 const word& fieldName
280 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
285 alpha*
sqr(phase_.thermo().nu()()())
290 eqn +=
rho()*interfaceFraction(alpha)
291 *C2_*aSqrnu*turbulence_.k()()/
pow4(delta_);
295 eqn +=
rho()*interfaceFraction(alpha)
296 *beta_*aSqrnu/(
sqr(betaStar_)*
pow4(delta_));
301 <<
"Support for field " << fieldName <<
" is not implemented" 317 const polyDistributionMap&
interfaceTurbulenceDamping(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
fvsPatchField< scalar > fvsPatchScalarField
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fluidReactionThermo & thermo
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &)
Return a temporary field constructed from name, mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
GeometricField< vector, fvPatchField, volMesh > volVectorField
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
virtual bool movePoints()
Update for mesh motion.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
const dimensionSet dimLength
GeometricField< scalar, fvPatchField, volMesh > volScalarField
compressibleMomentumTransportModel momentumTransportModel
stressControl lookup("compactNormalStress") >> compactNormalStress
Calculate the gradient of the given field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
virtual const word & type() const =0
Runtime type information.
UPtrList< phaseModel > phaseModelPartialList
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
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.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to mixture epsilon or omega equation.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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.
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField