30 #include "surfaceInterpolate.H" 47 tmp<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();
107 tmp<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;
143 <<
"Incorrect dimensions of phi: " <<
phi.dimensions()
161 "ddt("+dt.
name()+
')',
162 mesh().time().timeName(),
178 tdtdt.
ref().primitiveFieldRef() =
180 *(1.0 -
mesh().Vsc0()/
mesh().Vsc());
184 tdtdt.ref().boundaryFieldRef().
185 template evaluateCoupled<coupledFvPatch>();
216 "ddt("+vf.
name()+
')',
217 mesh().time().timeName(),
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()+
')',
276 mesh().time().timeName(),
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()+
')',
335 mesh().time().timeName(),
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>
398 mesh().time().timeName(),
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());
513 scalarField rDeltaT(CorDeltaT()().primitiveField());
550 scalarField rDeltaT(CorDeltaT()().primitiveField());
552 fvm.
diag() = rDeltaT*
rho.primitiveField()*
mesh().Vsc();
557 *
rho.oldTime().primitiveField()
563 *
rho.oldTime().primitiveField()
590 scalarField rDeltaT(CorDeltaT()().primitiveField());
593 rDeltaT*
alpha.primitiveField()*
rho.primitiveField()*
mesh().Vsc();
598 *
alpha.oldTime().primitiveField()
599 *
rho.oldTime().primitiveField()
605 *
alpha.oldTime().primitiveField()
606 *
rho.oldTime().primitiveField()
624 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
625 fluxFieldType phiCorr
636 "ddtCorr(" +
U.name() +
',' +
Uf.name() +
')',
637 mesh().time().timeName(),
640 this->fvcDdtPhiCoeff(
U.oldTime(), phiUf0, phiCorr)
652 const fluxFieldType&
phi 657 fluxFieldType phiCorr
668 "ddtCorr(" +
U.name() +
',' +
phi.name() +
')',
669 mesh().time().timeName(),
672 this->fvcDdtPhiCoeff(
U.oldTime(),
phi.oldTime(), phiCorr)
698 rho.oldTime()*
U.oldTime()
701 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
711 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
712 mesh().time().timeName(),
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() +
')',
740 mesh().time().timeName(),
756 <<
"dimensions of Uf are not correct" 759 return fluxFieldType::null();
770 const fluxFieldType&
phi 783 rho.oldTime()*
U.oldTime()
786 fluxFieldType phiCorr
798 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
799 mesh().time().timeName(),
818 fluxFieldType phiCorr
823 return tmp<fluxFieldType>
830 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
831 mesh().time().timeName(),
847 <<
"dimensions of phi are not correct" 850 return fluxFieldType::null();
879 tmeshPhi.ref().setOriented();
fvsPatchField< scalar > fvsPatchScalarField
const scalarField & diag() const
const Type & value() const noexcept
Return const reference to value.
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDdt(const dimensioned< Type > &)
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static tmp< GeometricField< typename innerProduct< vector, Type >::type, fvsPatchField, surfaceMesh > > dotInterpolate(const surfaceVectorField &Sf, const GeometricField< Type, fvPatchField, volMesh > &tvf)
Interpolate field onto faces.
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
Generic dimensioned Type class.
Ignore writing from objectRegistry::writeObject()
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimVolume(pow3(dimLength))
tmp< surfaceScalarField > meshPhi(const GeometricField< Type, fvPatchField, volMesh > &)
tmp< fluxFieldType > fvcDdtUfCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
autoPtr< surfaceVectorField > Uf
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
errorManip< error > abort(error &err)
Calculate the divergence of the given field.
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.
const dimensionSet dimDensity
const word & name() const noexcept
Return const reference to name.
Field< Type > & source() noexcept
tmp< fvMatrix< Type > > fvmDdt(const GeometricField< Type, fvPatchField, volMesh > &)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
tmp< fluxFieldType > fvcDdtPhiCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static const word & extrapolatedCalculatedType() noexcept
The type name for extrapolatedCalculated patch fields combines zero-gradient and calculated.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Defines the attributes of an object for which implicit objectRegistry management is supported...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Do not request registration (bool: false)
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity