29#include "surfaceInterpolate.H"
46template<
class Type,
class GType>
77 fvm.internalCoeffs()[patchi] =
79 fvm.boundaryCoeffs()[patchi] =
93template<
class Type,
class GType>
95relaxedNonOrthoGaussLaplacianScheme<Type, GType>::gammaSnGradCorr
109 "gammaSnGradCorr("+vf.
name()+
')',
121 for (
direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
123 tgammaSnGradCorr.
ref().replace
130 return tgammaSnGradCorr;
136template<
class Type,
class GType>
147 fvc::div(this->tsnGradScheme_().snGrad(vf)*
mesh.magSf())
150 tLaplacian.
ref().rename(
"laplacian(" + vf.
name() +
')');
156template<
class Type,
class GType>
180 this->tsnGradScheme_().deltaCoeffs(vf),
185 tmp<SType> tfaceFluxCorrection = gammaSnGradCorr(SfGammaCorr, vf);
187 if (this->tsnGradScheme_().corrected())
189 tfaceFluxCorrection.
ref() +=
190 SfGammaSn*this->tsnGradScheme_().correction(vf);
193 const word corrName(tfaceFluxCorrection().
name());
197 const word oldName(corrName +
"_0");
198 const scalar
relax(vf.
mesh().equationRelaxationFactor(oldName));
205 trelaxedCorrection.ref() *=
relax;
206 trelaxedCorrection.ref() += (1.0-
relax)*oldCorrection;
208 oldCorrection = tfaceFluxCorrection;
212 SType*
s =
new SType(oldName, tfaceFluxCorrection);
221 )().primitiveField();
232template<
class Type,
class GType>
254 SfGammaSn*this->tsnGradScheme_().snGrad(vf)
255 + gammaSnGradCorr(SfGammaCorr, vf)
259 tLaplacian.
ref().rename
261 "laplacian(" +
gamma.name() +
',' + vf.
name() +
')'
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
Generic GeometricField class.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
const fileName & instance() const noexcept
Read access to instance path component.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
faceFluxFieldPtrType & faceFluxCorrectionPtr()
Return pointer to face-flux non-orthogonal correction field.
Field< Type > & source() noexcept
Mesh data needed to do the Finite Volume discretisation.
virtual bool coupled() const
True if the patch field is coupled.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
tmp< snGradScheme< Type > > tsnGradScheme_
const fvMesh & mesh() const
Return mesh reference.
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< Type, fvPatchField, volMesh > &)
tmp< fvMatrix< Type > > fvmLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
static tmp< fvMatrix< Type > > fvmLaplacianUncorrected(const surfaceScalarField &gammaMagSf, const surfaceScalarField &deltaCoeffs, const GeometricField< Type, fvPatchField, volMesh > &)
Registry of regIOobjects.
bool foundObject(const word &name, const bool recursive=false) const
Contains the named Type?
Type & lookupObjectRef(const word &name, const bool recursive=false) const
Lookup and return non-const reference to the object of the given Type. Fatal if not found or the wron...
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A class for handling words, derived from Foam::string.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Calculate the divergence of the given field.
Calculate the gradient of the given field.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for finite-volume.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
static tmp< GeometricField< typename innerProduct< vector, Type >::type, fvsPatchField, surfaceMesh > > dotInterpolate(const surfaceVectorField &Sf, const GeometricField< Type, fvPatchField, volMesh > &tvf)
Interpolate field onto faces.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Namespace of functions to calculate implicit derivatives returning a matrix.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static scalar Sn(const scalar a, const scalar x)
fvsPatchField< scalar > fvsPatchScalarField
#define forAll(list, i)
Loop across all elements in list.