32 #include "surfaceInterpolate.H" 48 namespace patchDistMethods
57 Foam::patchDistMethods::advectionDiffusion::advectionDiffusion
68 coeffs_(
dict.subDict(
type() +
"Coeffs")),
78 epsilon_(coeffs_.getOrDefault<scalar>(
"epsilon", 0.1)),
79 tolerance_(coeffs_.getOrDefault<scalar>(
"tolerance", 1
e-3)),
80 maxIter_(coeffs_.getOrDefault<int>(
"maxIter", 10)),
83 (coeffs_.lookupOrDefault<bool>(
"checkAndWriteMesh", true))
103 pdmPredictor_->correct(
y);
110 if (checkAndWriteMesh_)
113 <<
"Checking mesh in advectionDiffusion " <<
endl;
114 if (mesh_.checkMesh(
true))
121 mesh_.pointsInstance(),
139 mesh_.time().timeName(),
147 patchTypes<vector>(mesh_, patchIDs_)
153 for (
const label patchi : patchIDs_)
155 nybf[patchi] == -
patches[patchi].nf();
164 mesh_.time().timeName(),
176 scalar initialResidual = 0;
181 ny /= (
mag(ny) + SMALL);
184 nf /= (
mag(nf) + SMALL);
200 initialResidual = yEqn.solve().initialResidual();
203 }
while (initialResidual > tolerance_ && ++iter < maxIter_);
const labelList patchIDs(pbm.indices(polyPatchNames, true))
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
fvMatrix< scalar > fvScalarMatrix
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
addToRunTimeSelectionTable(patchDistMethod, advectionDiffusion, dictionary)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Calculate the matrix for the laplacian of the field.
GeometricBoundaryField< vector, fvPatchField, volMesh > Boundary
Type of boundary fields.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar e
Elementary charge.
Calculate the gradient of the given field.
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
#define DebugInfo
Report an information message using Foam::Info.
Calculate the divergence of the given field.
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/chef2/andy/OpenFOAM/release/v2312/OpenFOAM-v2312/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
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.
static const GeometricField< vector, fvPatchField, volMesh > & null()
Return a null geometric field.
Calculate the matrix for the divergence of the given field and flux.
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)
Mesh data needed to do the Finite Volume discretisation.
defineTypeNameAndDebug(advectionDiffusion, 0)
const polyBoundaryMesh & patches
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Specialisation of patchDist for wall distance calculation.
A primitive field of type <T> with automated input and output.
Do not request registration (bool: false)
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
Calculation of approximate distance to nearest patch for all cells and boundary by solving the Eikona...
Calculate the finiteVolume matrix for implicit and explicit sources.
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
static constexpr const zero Zero
Global zero (0)