27 #include "surfaceInterpolate.H" 44 scalar backwardDdtScheme<Type>::deltaT_()
const 46 return mesh().time().deltaTValue();
51 scalar backwardDdtScheme<Type>::deltaT0_()
const 53 return mesh().time().deltaT0Value();
58 template<
class GeoField>
59 scalar backwardDdtScheme<Type>::deltaT0_(
const GeoField& vf)
const 61 if (vf.nOldTimes() < 2)
75 tmp<GeometricField<Type, fvPatchField, volMesh>>
83 const word ddtName(
"ddt("+dt.
name()+
')');
85 const scalar deltaT = deltaT_();
86 const scalar deltaT0 = deltaT0_();
88 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
89 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
90 const scalar coefft0 = coefft + coefft00;
109 tdtdt.
ref().primitiveFieldRef() = rDeltaT.
value()*dt.
value()*
111 coefft - (coefft0*
mesh().V0() - coefft00*
mesh().V00())/
mesh().V()
146 const word ddtName(
"ddt("+vf.
name()+
')');
148 const scalar deltaT = deltaT_();
149 const scalar deltaT0 = deltaT0_(vf);
151 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
152 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
153 const scalar coefft0 = coefft + coefft00;
167 - coefft00*vf.
oldTime().oldTime()()
175 coefft0*vf.
oldTime().boundaryField()
176 - coefft00*vf.
oldTime().oldTime().boundaryField()
193 + coefft00*vf.
oldTime().oldTime()
211 const word ddtName(
"ddt("+rho.
name()+
','+vf.
name()+
')');
213 const scalar deltaT = deltaT_();
214 const scalar deltaT0 = deltaT0_(vf);
216 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
217 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
218 const scalar coefft0 = coefft + coefft00;
232 - coefft00*vf.
oldTime().oldTime()()
240 coefft0*vf.
oldTime().boundaryField()
241 - coefft00*vf.
oldTime().oldTime().boundaryField()
258 + coefft00*vf.
oldTime().oldTime()
276 const word ddtName(
"ddt("+rho.
name()+
','+vf.
name()+
')');
278 const scalar deltaT = deltaT_();
279 const scalar deltaT0 = deltaT0_(vf);
281 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
282 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
283 const scalar coefft0 = coefft + coefft00;
309 *vf.
oldTime().oldTime().boundaryField()
347 const scalar deltaT = deltaT_();
348 const scalar deltaT0 = deltaT0_(vf);
350 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
351 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
352 const scalar coefft0 = coefft + coefft00;
388 *vf.
oldTime().oldTime().boundaryField()
432 const scalar rDeltaT = 1.0/deltaT_();
434 const scalar deltaT = deltaT_();
435 const scalar deltaT0 = deltaT0_(vf);
437 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
438 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
439 const scalar coefft0 = coefft + coefft00;
441 fvm.
diag() = (coefft*rDeltaT)*
mesh().V();
448 - coefft00*vf.
oldTime().oldTime().primitiveField()
456 coefft0*vf.
oldTime().primitiveField()
457 - coefft00*vf.
oldTime().oldTime().primitiveField()
483 const scalar rDeltaT = 1.0/deltaT_();
485 const scalar deltaT = deltaT_();
486 const scalar deltaT0 = deltaT0_(vf);
488 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
489 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
490 const scalar coefft0 = coefft + coefft00;
499 - coefft00*vf.
oldTime().oldTime().primitiveField()
507 coefft0*vf.
oldTime().primitiveField()
508 - coefft00*vf.
oldTime().oldTime().primitiveField()
534 const scalar rDeltaT = 1.0/deltaT_();
536 const scalar deltaT = deltaT_();
537 const scalar deltaT0 = deltaT0_(vf);
539 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
540 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
541 const scalar coefft0 = coefft + coefft00;
552 *vf.
oldTime().oldTime().primitiveField()*
mesh().V00()
562 *vf.
oldTime().oldTime().primitiveField()
589 const scalar rDeltaT = 1.0/deltaT_();
591 const scalar deltaT = deltaT_();
592 const scalar deltaT0 = deltaT0_(vf);
594 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
595 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
596 const scalar coefft0 = coefft + coefft00;
613 *vf.
oldTime().oldTime().primitiveField()*
mesh().V00()
628 *vf.
oldTime().oldTime().primitiveField()
646 const scalar deltaT = deltaT_();
647 const scalar deltaT0 = deltaT0_(U);
649 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
650 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
651 const scalar coefft0 = coefft + coefft00;
655 "ddtCorr(" + U.
name() +
',' + Uf.
name() +
')',
682 const scalar deltaT = deltaT_();
683 const scalar deltaT0 = deltaT0_(U);
685 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
686 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
687 const scalar coefft0 = coefft + coefft00;
691 "ddtCorr(" + U.
name() +
',' + phi.
name() +
')',
717 const scalar deltaT = deltaT_();
718 const scalar deltaT0 = deltaT0_(U);
720 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
721 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
722 const scalar coefft0 = coefft + coefft00;
742 "ddtCorr(" + rho.
name() +
',' + U.
name() +
',' + Uf.
name() +
')',
767 "ddtCorr(" + rho.
name() +
',' + U.
name() +
',' + Uf.
name() +
')',
782 - coefft00*U.
oldTime().oldTime()
791 <<
"dimensions of phi are not correct" 794 return fluxFieldType::null();
810 const scalar deltaT = deltaT_();
811 const scalar deltaT0 = deltaT0_(U);
813 const scalar coefft = 1 + deltaT/(deltaT + deltaT0);
814 const scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
815 const scalar coefft0 = coefft + coefft00;
835 "ddtCorr(" + rho.
name() +
',' + U.
name() +
',' + phi.
name() +
')',
843 coefft0*rhoU0 - coefft00*rhoU00
856 "ddtCorr(" + rho.
name() +
',' + U.
name() +
',' + phi.
name() +
')',
872 <<
"dimensions of phi are not correct" 875 return fluxFieldType::null();
886 const scalar deltaT = deltaT_();
887 const scalar deltaT0 = deltaT0_(vf);
890 const scalar coefft0_00 = deltaT/(deltaT + deltaT0);
893 const scalar coefftn_0 = 1 + coefft0_00;
910 const scalar deltaT = deltaT_();
911 const scalar deltaT0 = deltaT0_(vf);
914 const scalar coefft0_00 = deltaT/(deltaT + deltaT0);
917 const scalar coefftn_0 = 1 + coefft0_00;
921 coefftn_0*
mesh().phi().boundaryField()[
patchi]
922 - coefft0_00*
mesh().phi().oldTime().boundaryField()[
patchi]
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
virtual tmp< fvMatrix< Type > > fvmDdt(const GeometricField< Type, fvPatchField, volMesh > &)
const word & name() const
Return name.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
T & ref() const
Return non-const reference or generate a fatal error.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
static tmp< GeometricField< typename innerProduct< vector, Type >::type, fvsPatchField, surfaceMesh > > dotInterpolate(const surfaceVectorField &Sf, const GeometricField< Type, fvPatchField, volMesh > &tvf)
Interpolate field onto faces.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDdt(const dimensioned< Type > &)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Generic GeometricField class.
Generic dimensioned Type class.
virtual tmp< surfaceScalarField > meshPhi(const GeometricField< Type, fvPatchField, volMesh > &)
const dimensionSet dimTime
const dimensionSet & dimensions() const
Return dimensions.
A class for handling words, derived from string.
const dimensionSet dimVol
const dimensionSet dimFlux
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
const Type & value() const
Return const reference to value.
virtual tmp< fluxFieldType > fvcDdtPhiCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const fluxFieldType &phi)
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.
virtual tmp< fluxFieldType > fvcDdtUfCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
errorManip< error > abort(error &err)
Calculate the divergence of the given field.
const dimensionSet dimVelocity
const word & name() const
Return const reference to name.
word name(const complex &)
Return a string representation of a complex.
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.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const dimensionSet & dimensions() const
Return const reference to dimensions.
A class for managing temporary objects.