Second-oder Crank-Nicolson implicit ddt using the current and previous time-step fields as well as the previous time-step ddt. More...
Public Types | |
typedef ddtScheme< Type >::fluxFieldType | fluxFieldType |
Public Types inherited from ddtScheme< Type > | |
typedef GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > | fluxFieldType |
Additional Inherited Members | |
Static Public Member Functions inherited from ddtScheme< Type > | |
static tmp< ddtScheme< Type > > | New (const fvMesh &mesh, Istream &schemeData) |
Return a pointer to a new ddtScheme created on freestore. More... | |
Protected Member Functions inherited from ddtScheme< Type > | |
ddtScheme (const ddtScheme &) | |
Disallow copy construct. More... | |
void | operator= (const ddtScheme &) |
Disallow default bitwise assignment. More... | |
Protected Member Functions inherited from refCount | |
refCount () | |
Construct null initializing count to 0. More... | |
Protected Attributes inherited from ddtScheme< Type > | |
const fvMesh & | mesh_ |
Second-oder Crank-Nicolson implicit ddt using the current and previous time-step fields as well as the previous time-step ddt.
The Crank-Nicolson scheme is often unstable for complex flows in complex geometries and it is necessary to "off-centre" the scheme to stabilize it while retaining greater temporal accuracy than the first-order Euler-implicit scheme. Off-centering is specified via the mandatory coefficient in the range [0,1] following the scheme name e.g.
ddtSchemes { default CrankNicolson 0.9; }
With a coefficient of 1 the scheme is fully centred and second-order, with a coefficient of 0 the scheme is equivalent to Euler-implicit. A coefficient of 0.9 has been found to be suitable for a range of cases for which higher-order accuracy in time is needed and provides similar accuracy and stability to the backward scheme. However, the backward scheme has been found to be more robust and provides formal second-order accuracy in time.
The advantage of the Crank-Nicolson scheme over backward is that only the new and old-time values are needed, the additional terms relating to the fluxes and sources are evaluated at the mid-point of the time-step which provides the opportunity to limit the fluxes in such a way as to ensure boundedness while maintaining greater accuracy in time compared to the Euler-implicit scheme. This approach is now used with MULES in the interFoam family of solvers. Boundedness cannot be guaranteed with the backward scheme.
cnCoeff = 1.0/(1.0 + ocCoeff);
Definition at line 94 of file CrankNicolsonDdtScheme.H.
typedef ddtScheme<Type>::fluxFieldType fluxFieldType |
Definition at line 287 of file CrankNicolsonDdtScheme.H.
|
inline |
Construct from mesh.
Definition at line 196 of file CrankNicolsonDdtScheme.H.
|
inline |
Construct from mesh and Istream.
Definition at line 203 of file CrankNicolsonDdtScheme.H.
References Foam::exit(), Foam::FatalIOError, and FatalIOErrorInFunction.
TypeName | ( | "CrankNicolson" | ) |
Runtime type information.
|
inline |
Return mesh reference.
Definition at line 223 of file CrankNicolsonDdtScheme.H.
References ddtScheme< Type >::mesh().
|
inline |
Return the off-centreing coefficient.
Definition at line 229 of file CrankNicolsonDdtScheme.H.
References Foam::constant::atomic::alpha, CrankNicolsonDdtScheme< Type >::fvcDdt(), CrankNicolsonDdtScheme< Type >::fvmDdt(), psi, and rho.
|
virtual |
Implements ddtScheme< Type >.
Definition at line 285 of file CrankNicolsonDdtScheme.C.
References dimensioned< Type >::dimensions(), Foam::dimTime, CoEulerDdtScheme< Type >::mesh(), dimensioned< Type >::name(), fvMesh::time(), Time::timeName(), fvMesh::V(), fvMesh::V0(), fvMesh::V00(), and Foam::Zero.
Referenced by Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvcDdt(), and CrankNicolsonDdtScheme< Type >::ocCoeff().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 347 of file CrankNicolsonDdtScheme.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMesh::time(), Time::timeName(), fvMesh::V(), fvMesh::V0(), and fvMesh::V00().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 434 of file CrankNicolsonDdtScheme.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), dimensioned< Type >::dimensions(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::mesh(), dimensioned< Type >::name(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), fvMesh::time(), Time::timeName(), fvMesh::V(), fvMesh::V0(), fvMesh::V00(), and dimensioned< Type >::value().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 524 of file CrankNicolsonDdtScheme.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), fvMesh::time(), Time::timeName(), fvMesh::V(), fvMesh::V0(), and fvMesh::V00().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 624 of file CrankNicolsonDdtScheme.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), fvMesh::time(), Time::timeName(), fvMesh::V(), fvMesh::V0(), and fvMesh::V00().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 754 of file CrankNicolsonDdtScheme.C.
References lduMatrix::diag(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimTime, Foam::dimVol, Foam::fv::ff(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMatrix< Type >::source(), fvMesh::V(), fvMesh::V0(), and fvMesh::V00().
Referenced by CrankNicolsonDdtScheme< Type >::fvcDdt(), CrankNicolsonDdtScheme< Type >::fvmDdt(), and CrankNicolsonDdtScheme< Type >::ocCoeff().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 836 of file CrankNicolsonDdtScheme.C.
References lduMatrix::diag(), dimensioned< Type >::dimensions(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimTime, Foam::dimVol, Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::mesh(), dimensioned< Type >::name(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMatrix< Type >::source(), fvMesh::V(), fvMesh::V0(), fvMesh::V00(), and dimensioned< Type >::value().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 918 of file CrankNicolsonDdtScheme.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), lduMatrix::diag(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimTime, Foam::dimVol, Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), fvMatrix< Type >::source(), fvMesh::V(), fvMesh::V0(), and fvMesh::V00().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 1008 of file CrankNicolsonDdtScheme.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), lduMatrix::diag(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimTime, Foam::dimVol, Foam::fv::ff(), CrankNicolsonDdtScheme< Type >::fvcDdtUfCorr(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), fvMatrix< Type >::source(), fvMesh::V(), fvMesh::V0(), and fvMesh::V00().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 1119 of file CrankNicolsonDdtScheme.C.
References DimensionedField< Type, GeoMesh >::dimensions(), ddtScheme< Type >::fvcDdtPhiCoeff(), CrankNicolsonDdtScheme< Type >::fvcDdtPhiCorr(), Foam::fvc::interpolate(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMesh::Sf(), fvMesh::time(), and Time::timeName().
Referenced by CrankNicolsonDdtScheme< Type >::fvcDdtPhiCorr(), and CrankNicolsonDdtScheme< Type >::fvmDdt().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 1180 of file CrankNicolsonDdtScheme.C.
References DimensionedField< Type, GeoMesh >::dimensions(), Foam::fvc::dotInterpolate(), ddtScheme< Type >::fvcDdtPhiCoeff(), CrankNicolsonDdtScheme< Type >::fvcDdtUfCorr(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMesh::Sf(), fvMesh::time(), and Time::timeName().
Referenced by CrankNicolsonDdtScheme< Type >::fvcDdtUfCorr().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 1242 of file CrankNicolsonDdtScheme.C.
References Foam::abort(), Foam::fvc::ddtCorr(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimVelocity, Foam::FatalError, FatalErrorInFunction, ddtScheme< Type >::fvcDdtPhiCoeff(), CrankNicolsonDdtScheme< Type >::fvcDdtPhiCorr(), CoEulerDdtScheme< Type >::fvcDdtUfCorr(), Foam::fvc::interpolate(), CoEulerDdtScheme< Type >::mesh(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::null(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMesh::Sf(), fvMesh::time(), and Time::timeName().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 1337 of file CrankNicolsonDdtScheme.C.
References Foam::abort(), Foam::fvc::ddtCorr(), Foam::dimArea, DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimVelocity, Foam::fvc::dotInterpolate(), Foam::FatalError, FatalErrorInFunction, ddtScheme< Type >::fvcDdtPhiCoeff(), CoEulerDdtScheme< Type >::fvcDdtPhiCorr(), CoEulerDdtScheme< Type >::mesh(), CrankNicolsonDdtScheme< Type >::meshPhi(), IOobject::name(), GeometricField< Type, PatchField, GeoMesh >::null(), GeometricField< Type, PatchField, GeoMesh >::oldTime(), fvMesh::Sf(), fvMesh::time(), and Time::timeName().
|
virtual |
Implements ddtScheme< Type >.
Definition at line 1432 of file CrankNicolsonDdtScheme.C.
References Foam::dimVolume, CoEulerDdtScheme< Type >::mesh(), Foam::name(), IOobject::NO_READ, IOobject::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::oldTime(), phi, fvMesh::phi(), and timeName.
Referenced by CrankNicolsonDdtScheme< Type >::fvcDdtPhiCorr().
tmp< surfaceScalarField > fvcDdtUfCorr | ( | const GeometricField< scalar, fvPatchField, volMesh > & | U, |
const GeometricField< scalar, fvsPatchField, surfaceMesh > & | Uf | ||
) |
tmp< surfaceScalarField > fvcDdtPhiCorr | ( | const volScalarField & | U, |
const surfaceScalarField & | phi | ||
) |
tmp< surfaceScalarField > fvcDdtUfCorr | ( | const volScalarField & | rho, |
const volScalarField & | U, | ||
const surfaceScalarField & | Uf | ||
) |
tmp< surfaceScalarField > fvcDdtPhiCorr | ( | const volScalarField & | rho, |
const volScalarField & | U, | ||
const surfaceScalarField & | phi | ||
) |