30#include "surfaceInterpolate.H"
46void SLTSDdtScheme<Type>::relaxedDiag
60 diag[owner[facei]] +=
phi[facei];
61 rD[neighbour[facei]] +=
phi[facei];
65 diag[neighbour[facei]] -=
phi[facei];
66 rD[owner[facei]] -=
phi[facei];
73 const labelUList& faceCells = pphi.patch().patch().faceCells();
77 if (pphi[patchFacei] > 0.0)
79 diag[faceCells[patchFacei]] += pphi[patchFacei];
83 rD[faceCells[patchFacei]] -= pphi[patchFacei];
88 rD += (1.0/alpha_ - 2.0)*
diag;
93tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT()
const
96 mesh().objectRegistry::template
97 lookupObject<surfaceScalarField>(phiName_);
119 relaxedDiag(rDeltaT,
phi);
121 if (
phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
123 rDeltaT.primitiveFieldRef() =
max
125 rDeltaT.primitiveField()/
mesh().
V(),
126 scalar(1)/deltaT.value()
129 else if (
phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
132 mesh().objectRegistry::template lookupObject<volScalarField>
139 rDeltaT.primitiveField()/(
rho.primitiveField()*
mesh().
V()),
140 scalar(1)/deltaT.value()
146 <<
"Incorrect dimensions of phi: " <<
phi.dimensions()
150 rDeltaT.correctBoundaryConditions();
167 "ddt("+dt.
name()+
')',
184 tdtdt.
ref().primitiveFieldRef() =
189 tdtdt.
ref().boundaryFieldRef().
190 template evaluateCoupled<coupledFvPatch>();
221 "ddt("+vf.
name()+
')',
249 tdtdt.
ref().boundaryFieldRef().
250 template evaluateCoupled<coupledFvPatch>();
256 return tmp<GeometricField<Type, fvPatchField, volMesh>>
258 new GeometricField<Type, fvPatchField, volMesh>
280 "ddt("+
rho.name()+
','+vf.
name()+
')',
308 tdtdt.
ref().boundaryFieldRef().
309 template evaluateCoupled<coupledFvPatch>();
315 return tmp<GeometricField<Type, fvPatchField, volMesh>>
317 new GeometricField<Type, fvPatchField, volMesh>
339 "ddt("+
rho.name()+
','+vf.
name()+
')',
356 -
rho.oldTime().primitiveField()
362 -
rho.oldTime().boundaryField()
370 tdtdt.
ref().boundaryFieldRef().
371 template evaluateCoupled<coupledFvPatch>();
377 return tmp<GeometricField<Type, fvPatchField, volMesh>>
379 new GeometricField<Type, fvPatchField, volMesh>
419 alpha.primitiveField()
420 *
rho.primitiveField()
423 -
alpha.oldTime().primitiveField()
424 *
rho.oldTime().primitiveField()
429 alpha.boundaryField()
433 -
alpha.oldTime().boundaryField()
434 *
rho.oldTime().boundaryField()
442 tdtdt.
ref().boundaryFieldRef().
443 template evaluateCoupled<coupledFvPatch>();
449 return tmp<GeometricField<Type, fvPatchField, volMesh>>
451 new GeometricField<Type, fvPatchField, volMesh>
483 scalarField rDeltaT(SLrDeltaT()().primitiveField());
485 fvm.diag() = rDeltaT*
mesh().V();
518 scalarField rDeltaT(SLrDeltaT()().primitiveField());
524 fvm.source() = rDeltaT
529 fvm.source() = rDeltaT
555 scalarField rDeltaT(SLrDeltaT()().primitiveField());
557 fvm.diag() = rDeltaT*
rho.primitiveField()*
mesh().V();
561 fvm.source() = rDeltaT
562 *
rho.oldTime().primitiveField()
567 fvm.source() = rDeltaT
568 *
rho.oldTime().primitiveField()
595 scalarField rDeltaT(SLrDeltaT()().primitiveField());
598 rDeltaT*
alpha.primitiveField()*
rho.primitiveField()*
mesh().Vsc();
602 fvm.source() = rDeltaT
603 *
alpha.oldTime().primitiveField()
604 *
rho.oldTime().primitiveField()
609 fvm.source() = rDeltaT
610 *
alpha.oldTime().primitiveField()
611 *
rho.oldTime().primitiveField()
641 "ddtCorr(" +
U.name() +
',' +
Uf.name() +
')',
645 this->fvcDdtPhiCoeff(
U.oldTime(), phiUf0, phiCorr)
673 "ddtCorr(" +
U.name() +
',' +
phi.name() +
')',
677 this->fvcDdtPhiCoeff(
U.oldTime(),
phi.oldTime(), phiCorr)
703 rho.oldTime()*
U.oldTime()
716 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
720 this->fvcDdtPhiCoeff(rhoU0, phiUf0, phiCorr,
rho.oldTime())
731 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
732 fluxFieldType phiCorr
744 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
761 <<
"dimensions of Uf are not correct"
775 const fluxFieldType&
phi
788 rho.oldTime()*
U.oldTime()
791 fluxFieldType phiCorr
803 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
823 fluxFieldType phiCorr
828 return tmp<fluxFieldType>
835 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
852 <<
"dimensions of phi are not correct"
884 tmeshPhi.ref().setOriented();
const dimensionSet & dimensions() const noexcept
Return dimensions.
Generic GeometricField class.
static const this_type & null() noexcept
Return a null GeometricField (reference to a nullObject).
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef().
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
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.
@ NO_REGISTER
Do not request registration (bool: false).
@ 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.
Generic dimensioned Type class.
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
const word & name() const noexcept
Return const reference to name.
const Type & value() const noexcept
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Field< Type > & source() noexcept
static const word & calculatedType() noexcept
The type name for calculated patch fields.
static const word & extrapolatedCalculatedType() noexcept
The type name for extrapolatedCalculated patch fields combines zero-gradient and calculated.
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDdt(const dimensioned< Type > &)
tmp< fluxFieldType > fvcDdtPhiCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi)
tmp< fvMatrix< Type > > fvmDdt(const GeometricField< Type, fvPatchField, volMesh > &)
ddtScheme< Type >::fluxFieldType fluxFieldType
const fvMesh & mesh() const
Return mesh reference.
tmp< surfaceScalarField > meshPhi(const GeometricField< Type, fvPatchField, volMesh > &)
tmp< fluxFieldType > fvcDdtUfCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
tmp< surfaceScalarField > fvcDdtPhiCoeff(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi, const fluxFieldType &phiCorr)
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
tmp< volScalarField > trDeltaT
autoPtr< surfaceVectorField > Uf
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const expr V(m.psi().mesh().V())
Namespace for finite-volume.
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 tmp< GeometricField< typename innerProduct< vector, Type >::type, fvsPatchField, surfaceMesh > > dotInterpolate(const surfaceVectorField &Sf, const GeometricField< Type, fvPatchField, volMesh > &tvf)
Interpolate field onto faces.
Namespace of functions to calculate implicit derivatives returning a matrix.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const dimensionSet dimVolume(pow3(dimLength))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
const dimensionSet dimDensity
UList< label > labelUList
A UList of labels.
fvsPatchField< scalar > fvsPatchScalarField
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
#define forAll(list, i)
Loop across all elements in list.