29 #include "surfaceInterpolate.H" 46 tmp<volScalarField> CoEulerDdtScheme<Type>::CorDeltaT()
const 50 tmp<volScalarField> tcorDeltaT
57 cofrDeltaT.instance(),
62 extrapolatedCalculatedFvPatchScalarField::typeName
73 corDeltaT[owner[facei]] =
74 max(corDeltaT[owner[facei]], cofrDeltaT[facei]);
76 corDeltaT[neighbour[facei]] =
77 max(corDeltaT[neighbour[facei]], cofrDeltaT[facei]);
81 cofrDeltaT.boundaryField();
83 forAll(cofrDeltaTbf, patchi)
86 const fvPatch&
p = pcofrDeltaT.patch();
87 const labelUList& faceCells =
p.patch().faceCells();
89 forAll(pcofrDeltaT, patchFacei)
91 corDeltaT[faceCells[patchFacei]] =
max 93 corDeltaT[faceCells[patchFacei]],
94 pcofrDeltaT[patchFacei]
99 corDeltaT.correctBoundaryConditions();
106 tmp<surfaceScalarField> CoEulerDdtScheme<Type>::CofrDeltaT()
const 111 static_cast<const objectRegistry&
>(
mesh())
112 .lookupObject<surfaceScalarField>(phiName_);
114 if (
phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
123 return max(Co/maxCo_, scalar(1))/deltaT;
125 else if (
phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
128 static_cast<const objectRegistry&
>(
mesh())
129 .lookupObject<volScalarField>(rhoName_).oldTime();
138 return max(Co/maxCo_, scalar(1))/deltaT;
142 <<
"Incorrect dimensions of phi: " <<
phi.dimensions()
160 "ddt("+dt.
name()+
')',
161 mesh().time().timeName(),
177 tdtdt.
ref().primitiveFieldRef() =
179 *(1.0 -
mesh().Vsc0()/
mesh().Vsc());
210 "ddt("+vf.
name()+
')',
211 mesh().time().timeName(),
238 return tmp<GeometricField<Type, fvPatchField, volMesh>>
240 new GeometricField<Type, fvPatchField, volMesh>
262 "ddt("+
rho.name()+
','+vf.
name()+
')',
263 mesh().time().timeName(),
290 return tmp<GeometricField<Type, fvPatchField, volMesh>>
292 new GeometricField<Type, fvPatchField, volMesh>
314 "ddt("+
rho.name()+
','+vf.
name()+
')',
315 mesh().time().timeName(),
331 -
rho.oldTime().primitiveField()
337 -
rho.oldTime().boundaryField()
345 return tmp<GeometricField<Type, fvPatchField, volMesh>>
347 new GeometricField<Type, fvPatchField, volMesh>
371 mesh().time().timeName(),
387 alpha.primitiveField()
388 *
rho.primitiveField()
391 -
alpha.oldTime().primitiveField()
392 *
rho.oldTime().primitiveField()
397 alpha.boundaryField()
401 -
alpha.oldTime().boundaryField()
402 *
rho.oldTime().boundaryField()
410 return tmp<GeometricField<Type, fvPatchField, volMesh>>
412 new GeometricField<Type, fvPatchField, volMesh>
444 scalarField rDeltaT(CorDeltaT()().primitiveField());
479 scalarField rDeltaT(CorDeltaT()().primitiveField());
516 scalarField rDeltaT(CorDeltaT()().primitiveField());
518 fvm.
diag() = rDeltaT*
rho.primitiveField()*
mesh().Vsc();
523 *
rho.oldTime().primitiveField()
529 *
rho.oldTime().primitiveField()
556 scalarField rDeltaT(CorDeltaT()().primitiveField());
559 rDeltaT*
alpha.primitiveField()*
rho.primitiveField()*
mesh().Vsc();
564 *
alpha.oldTime().primitiveField()
565 *
rho.oldTime().primitiveField()
571 *
alpha.oldTime().primitiveField()
572 *
rho.oldTime().primitiveField()
590 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
591 fluxFieldType phiCorr
602 "ddtCorr(" +
U.name() +
',' +
Uf.name() +
')',
603 mesh().time().timeName(),
606 this->fvcDdtPhiCoeff(
U.oldTime(), phiUf0, phiCorr)
618 const fluxFieldType&
phi 623 fluxFieldType phiCorr
634 "ddtCorr(" +
U.name() +
',' +
phi.name() +
')',
635 mesh().time().timeName(),
638 this->fvcDdtPhiCoeff(
U.oldTime(),
phi.oldTime(), phiCorr)
664 rho.oldTime()*
U.oldTime()
667 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
677 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
678 mesh().time().timeName(),
681 this->fvcDdtPhiCoeff(rhoU0, phiUf0, phiCorr,
rho.oldTime())
692 fluxFieldType phiUf0(
mesh().Sf() &
Uf.oldTime());
693 fluxFieldType phiCorr
705 +
rho.name() +
',' +
U.name() +
',' +
Uf.name() +
')',
706 mesh().time().timeName(),
722 <<
"dimensions of Uf are not correct" 725 return fluxFieldType::null();
736 const fluxFieldType&
phi 749 rho.oldTime()*
U.oldTime()
752 fluxFieldType phiCorr
764 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
765 mesh().time().timeName(),
784 fluxFieldType phiCorr
789 return tmp<fluxFieldType>
796 +
rho.name() +
',' +
U.name() +
',' +
phi.name() +
')',
797 mesh().time().timeName(),
813 <<
"dimensions of phi are not correct" 816 return fluxFieldType::null();
845 tmeshPhi.ref().setOriented();
fvsPatchField< scalar > fvsPatchScalarField
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)
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
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.
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
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.
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