27 #include "surfaceInterpolate.H"
44 tmp<volScalarField> CoEulerDdtScheme<Type>::CorDeltaT()
const
48 tmp<volScalarField> tcorDeltaT
55 extrapolatedCalculatedFvPatchScalarField::typeName
62 const labelUList& neighbour = mesh().neighbour();
66 corDeltaT[owner[facei]] =
67 max(corDeltaT[owner[facei]], cofrDeltaT[facei]);
69 corDeltaT[neighbour[facei]] =
70 max(corDeltaT[neighbour[facei]], cofrDeltaT[facei]);
74 cofrDeltaT.boundaryField();
79 const fvPatch&
p = pcofrDeltaT.patch();
80 const labelUList& faceCells =
p.patch().faceCells();
82 forAll(pcofrDeltaT, patchFacei)
84 corDeltaT[faceCells[patchFacei]] =
max
86 corDeltaT[faceCells[patchFacei]],
87 pcofrDeltaT[patchFacei]
92 corDeltaT.correctBoundaryConditions();
99 tmp<surfaceScalarField> CoEulerDdtScheme<Type>::CofrDeltaT()
const
104 static_cast<const objectRegistry&
>(mesh())
105 .lookupObject<surfaceScalarField>(phiName_);
107 if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
112 *(
mag(phi)/mesh().magSf())
116 return max(Co/maxCo_, scalar(1))/deltaT;
118 else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
121 static_cast<const objectRegistry&
>(mesh())
122 .lookupObject<volScalarField>(rhoName_).oldTime();
131 return max(Co/maxCo_, scalar(1))/deltaT;
136 <<
"Incorrect dimensions of phi: " << phi.dimensions()
139 return tmp<surfaceScalarField>(
nullptr);
153 const word ddtName(
"ddt("+dt.
name()+
')');
172 tdtdt.
ref().primitiveFieldRef() =
174 *(1.0 - mesh().Vsc0()/mesh().Vsc());
208 const word ddtName(
"ddt("+vf.
name()+
')');
220 - vf.
oldTime()()*mesh().Vsc0()/mesh().Vsc()
253 const word ddtName(
"ddt("+
rho.name()+
','+vf.
name()+
')');
262 rDeltaT()*
rho.value()*
265 - vf.
oldTime()()*mesh().Vsc0()/mesh().Vsc()
298 const word ddtName(
"ddt("+
rho.name()+
','+vf.
name()+
')');
311 *vf.
oldTime()()*mesh().Vsc0()/mesh().Vsc()
316 -
rho.oldTime().boundaryField()
364 *vf.
oldTime()()*mesh().Vsc0()/mesh().Vsc()
368 alpha.boundaryField()
372 -
alpha.oldTime().boundaryField()
373 *
rho.oldTime().boundaryField()
415 const scalarField rDeltaT(CorDeltaT()().primitiveField());
417 fvm.
diag() = rDeltaT*mesh().Vsc();
421 fvm.
source() = rDeltaT*vf.
oldTime().primitiveField()*mesh().Vsc0();
425 fvm.
source() = rDeltaT*vf.
oldTime().primitiveField()*mesh().Vsc();
450 const scalarField rDeltaT(CorDeltaT()().primitiveField());
452 fvm.
diag() = rDeltaT*
rho.value()*mesh().Vsc();
457 *
rho.value()*vf.
oldTime().primitiveField()*mesh().Vsc0();
462 *
rho.value()*vf.
oldTime().primitiveField()*mesh().Vsc();
487 const scalarField rDeltaT(CorDeltaT()().primitiveField());
489 fvm.
diag() = rDeltaT*
rho.primitiveField()*mesh().Vsc();
494 *
rho.oldTime().primitiveField()
495 *vf.
oldTime().primitiveField()*mesh().Vsc0();
500 *
rho.oldTime().primitiveField()
501 *vf.
oldTime().primitiveField()*mesh().Vsc();
531 const scalarField rDeltaT(CorDeltaT()().primitiveField());
534 rDeltaT*
alpha.primitiveField()*
rho.primitiveField()*mesh().Vsc();
539 *
alpha.oldTime().primitiveField()
540 *
rho.oldTime().primitiveField()
541 *vf.
oldTime().primitiveField()*mesh().Vsc0();
546 *
alpha.oldTime().primitiveField()
547 *
rho.oldTime().primitiveField()
548 *vf.
oldTime().primitiveField()*mesh().Vsc();
573 "ddtCorr(" +
U.name() +
',' + Uf.
name() +
')',
574 this->fvcDdtPhiCoeff(
U.oldTime(), phiUf0, phiCorr)*rDeltaT*phiCorr
596 "ddtCorr(" +
U.name() +
',' + phi.
name() +
')',
597 this->fvcDdtPhiCoeff(
U.oldTime(), phi.
oldTime(), phiCorr)
622 rho.oldTime()*
U.oldTime()
630 "ddtCorr(" +
rho.name() +
',' +
U.name() +
',' + rhoUf.
name() +
')',
631 this->fvcDdtPhiCoeff(rhoU0, phiUf0, phiCorr,
rho.oldTime())
649 "ddtCorr(" +
rho.name() +
',' +
U.name() +
',' + rhoUf.
name() +
')',
662 <<
"dimensions of rhoUf are not correct"
665 return fluxFieldType::null();
689 rho.oldTime()*
U.oldTime()
699 "ddtCorr(" +
rho.name() +
',' +
U.name() +
',' + phi.
name() +
')',
722 "ddtCorr(" +
rho.name() +
',' +
U.name() +
',' + phi.
name() +
')',
735 <<
"dimensions of phi are not correct"
738 return fluxFieldType::null();
#define forAll(list, i)
Loop across all elements in list.
const dimensionSet & dimensions() const
Return dimensions.
Generic GeometricField class.
const Internal::FieldType & primitiveField() const
Return a const-reference to the primitive field.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
const word & name() const
Return name.
const FieldType & oldTime() const
Return the old time field.
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
Generic dimensioned Type class.
const dimensionSet & dimensions() const
Return const reference to dimensions.
const Type & value() const
Return const reference to value.
const word & name() const
Return const reference to name.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
virtual tmp< fluxFieldType > fvcDdtUfCorr(const VolField< Type > &U, const SurfaceField< Type > &Uf)
virtual tmp< fvMatrix< Type > > fvmDdt(const VolField< Type > &)
virtual tmp< surfaceScalarField > meshPhi(const VolField< Type > &)
virtual tmp< VolField< Type > > fvcDdt(const dimensioned< Type > &)
virtual tmp< fluxFieldType > fvcDdtPhiCorr(const VolField< Type > &U, const fluxFieldType &phi)
const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
#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.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
static tmp< SurfaceField< typename innerProduct< vector, Type >::type > > dotInterpolate(const surfaceVectorField &Sf, const VolField< Type > &tvf)
Interpolate field onto faces.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimVolumetricFlux
errorManip< error > abort(error &err)
SurfaceField< scalar > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet dimTime
const dimensionSet dimDensity
const dimensionSet dimVolume
VolField< scalar > volScalarField
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimVelocity
UList< label > labelUList
fvsPatchField< scalar > fvsPatchScalarField
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
faceListList boundary(nPatches)