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)),
82 checkAndWriteMesh_(coeffs_.getOrDefault(
"checkAndWriteMesh", false))
102 pdmPredictor_->correct(
y);
109 if (checkAndWriteMesh_)
112 <<
"Checking mesh in advectionDiffusion " <<
endl;
113 if (mesh_.checkMesh(
true))
120 mesh_.pointsInstance(),
138 mesh_.time().timeName(),
146 patchTypes<vector>(mesh_, patchIDs_)
152 for (
const label patchi : patchIDs_)
154 nybf[patchi] == -
patches[patchi].nf();
163 mesh_.time().timeName(),
175 scalar initialResidual = 0;
180 ny /= (
mag(ny) + SMALL);
183 nf /= (
mag(nf) + SMALL);
199 initialResidual = yEqn.solve().initialResidual();
202 }
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
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
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/v2506/OpenFOAM-v2506/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.
Calculate the matrix for the divergence of the given field and flux.
static const this_type & null() noexcept
Return a null GeometricField (reference to a nullObject).
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)
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
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)
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)