30 #include "surfaceInterpolate.H" 45 namespace patchDistMethods
54 Foam::patchDistMethods::advectionDiffusion::advectionDiffusion
65 coeffs_(
dict.subDict(
type() +
"Coeffs")),
75 epsilon_(coeffs_.getOrDefault<scalar>(
"epsilon", 0.1)),
76 tolerance_(coeffs_.getOrDefault<scalar>(
"tolerance", 1
e-3)),
77 maxIter_(coeffs_.getOrDefault<int>(
"maxIter", 10)),
98 pdmPredictor_->correct(
y);
107 mesh_.time().timeName(),
115 patchTypes<vector>(mesh_, patchIDs_)
121 for (
const label patchi : patchIDs_)
123 nybf[patchi] == -
patches[patchi].nf();
127 scalar initialResidual = 0;
132 ny /= (
mag(ny) + SMALL);
135 nf /= (
mag(nf) + SMALL);
149 initialResidual = yEqn.solve().initialResidual();
151 }
while (initialResidual > tolerance_ && ++iter < maxIter_);
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
fvMatrix< scalar > fvScalarMatrix
const labelList patchIDs(pbm.patchSet(polyPatchNames, false, true).sortedToc())
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.
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.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
Macros for easy insertion into run-time selection tables.
const dimensionedScalar e
Elementary charge.
Calculate the gradient of the given field.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
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/v2306/OpenFOAM-v2306/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.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
defineTypeNameAndDebug(advectionDiffusion, 0)
const polyBoundaryMesh & patches
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Defines the attributes of an object for which implicit objectRegistry management is supported...
Specialisation of patchDist for wall distance calculation.
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.
static constexpr const zero Zero
Global zero (0)