30#include "surfaceInterpolate.H"
47tmp<volScalarField> CoEulerDdtScheme<Type>::CorDeltaT()
const
51 tmp<volScalarField> tcorDeltaT
58 cofrDeltaT.instance(),
74 corDeltaT[owner[facei]] =
75 max(corDeltaT[owner[facei]], cofrDeltaT[facei]);
77 corDeltaT[neighbour[facei]] =
78 max(corDeltaT[neighbour[facei]], cofrDeltaT[facei]);
82 cofrDeltaT.boundaryField();
84 forAll(cofrDeltaTbf, patchi)
87 const fvPatch&
p = pcofrDeltaT.
patch();
88 const labelUList& faceCells =
p.patch().faceCells();
90 forAll(pcofrDeltaT, patchFacei)
92 corDeltaT[faceCells[patchFacei]] =
max
94 corDeltaT[faceCells[patchFacei]],
95 pcofrDeltaT[patchFacei]
100 corDeltaT.correctBoundaryConditions();
107tmp<surfaceScalarField> CoEulerDdtScheme<Type>::CofrDeltaT()
const
112 static_cast<const objectRegistry&
>(
mesh())
113 .lookupObject<surfaceScalarField>(phiName_);
115 if (
phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
124 return max(Co/maxCo_, scalar(1))/deltaT;
126 else if (
phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
129 static_cast<const objectRegistry&
>(
mesh())
130 .lookupObject<volScalarField>(rhoName_).
oldTime();
139 return max(Co/maxCo_, scalar(1))/deltaT;
161 "ddt("+dt.
name()+
')',
178 tdtdt.
ref().primitiveFieldRef() =
180 *(1.0 -
mesh().Vsc0()/
mesh().Vsc());
184 tdtdt.
ref().boundaryFieldRef().
185 template evaluateCoupled<coupledFvPatch>();
216 "ddt("+vf.
name()+
')',
244 tdtdt.
ref().boundaryFieldRef().
245 template evaluateCoupled<coupledFvPatch>();
251 return tmp<GeometricField<Type, fvPatchField, volMesh>>
253 new GeometricField<Type, fvPatchField, volMesh>
275 "ddt("+
rho.name()+
','+vf.
name()+
')',
303 tdtdt.
ref().boundaryFieldRef().
304 template evaluateCoupled<coupledFvPatch>();
310 return tmp<GeometricField<Type, fvPatchField, volMesh>>
312 new GeometricField<Type, fvPatchField, volMesh>
334 "ddt("+
rho.name()+
','+vf.
name()+
')',
351 -
rho.oldTime().primitiveField()
357 -
rho.oldTime().boundaryField()
365 tdtdt.
ref().boundaryFieldRef().
366 template evaluateCoupled<coupledFvPatch>();
372 return tmp<GeometricField<Type, fvPatchField, volMesh>>
374 new GeometricField<Type, fvPatchField, volMesh>
414 alpha.primitiveField()
415 *
rho.primitiveField()
418 -
alpha.oldTime().primitiveField()
419 *
rho.oldTime().primitiveField()
424 alpha.boundaryField()
428 -
alpha.oldTime().boundaryField()
429 *
rho.oldTime().boundaryField()
437 tdtdt.
ref().boundaryFieldRef().
438 template evaluateCoupled<coupledFvPatch>();
444 return tmp<GeometricField<Type, fvPatchField, volMesh>>
446 new GeometricField<Type, fvPatchField, volMesh>
478 scalarField rDeltaT(CorDeltaT()().primitiveField());
480 fvm.diag() = rDeltaT*
mesh().Vsc();
484 fvm.source() = rDeltaT*vf.
oldTime().primitiveField()*
mesh().Vsc0();
513 scalarField rDeltaT(CorDeltaT()().primitiveField());
515 fvm.diag() = rDeltaT*
rho.value()*
mesh().Vsc();
519 fvm.source() = rDeltaT
524 fvm.source() = rDeltaT
550 scalarField rDeltaT(CorDeltaT()().primitiveField());
552 fvm.diag() = rDeltaT*
rho.primitiveField()*
mesh().Vsc();
556 fvm.source() = rDeltaT
557 *
rho.oldTime().primitiveField()
562 fvm.source() = rDeltaT
563 *
rho.oldTime().primitiveField()
590 scalarField rDeltaT(CorDeltaT()().primitiveField());
593 rDeltaT*
alpha.primitiveField()*
rho.primitiveField()*
mesh().Vsc();
597 fvm.source() = rDeltaT
598 *
alpha.oldTime().primitiveField()
599 *
rho.oldTime().primitiveField()
604 fvm.source() = rDeltaT
605 *
alpha.oldTime().primitiveField()
606 *
rho.oldTime().primitiveField()
636 "ddtCorr(" +
U.name() +
',' +
Uf.name() +
')',
640 this->fvcDdtPhiCoeff(
U.oldTime(), phiUf0, phiCorr)
668 "ddtCorr(" +
U.name() +
',' +
phi.name() +
')',
672 this->fvcDdtPhiCoeff(
U.oldTime(),
phi.oldTime(), phiCorr)
698 rho.oldTime()*
U.oldTime()
711 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
715 this->fvcDdtPhiCoeff(rhoU0, phiUf0, phiCorr,
rho.oldTime())
726 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
727 fluxFieldType phiCorr
739 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
756 <<
"dimensions of Uf are not correct"
770 const fluxFieldType&
phi
783 rho.oldTime()*
U.oldTime()
786 fluxFieldType phiCorr
798 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
818 fluxFieldType phiCorr
823 return tmp<fluxFieldType>
830 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
847 <<
"dimensions of phi are not correct"
879 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().
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
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< fluxFieldType > fvcDdtUfCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
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< surfaceScalarField > fvcDdtPhiCoeff(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi, const fluxFieldType &phiCorr)
const fvPatch & patch() const noexcept
Return the patch.
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
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.
Calculate the divergence of the given field.
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 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.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
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.