Renamed CrankNicolson scheme: correct spelling

This commit is contained in:
Hrvoje Jasak 2015-04-23 15:22:00 +01:00
parent d98283de31
commit 3f2807735d
8 changed files with 71 additions and 56 deletions

View file

@ -35,7 +35,7 @@ Description
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "EulerDdtScheme.H" #include "EulerDdtScheme.H"
#include "CrankNicholsonDdtScheme.H" #include "CrankNicolsonDdtScheme.H"
#include "backwardDdtScheme.H" #include "backwardDdtScheme.H"
#include "tetFemMatrices.H" #include "tetFemMatrices.H"
@ -480,7 +480,7 @@ bool freeSurface::movePoints(const scalarField& interfacePhi)
if if
( (
ddtScheme ddtScheme
== fv::CrankNicholsonDdtScheme<vector>::typeName == fv::CrankNicolsonDdtScheme<vector>::typeName
) )
{ {
sweptVolCorr *= (1.0/2.0)*DB().deltaT().value(); sweptVolCorr *= (1.0/2.0)*DB().deltaT().value();
@ -890,7 +890,7 @@ bool freeSurface::moveMeshPoints()
if if
( (
ddtScheme ddtScheme
== fv::CrankNicholsonDdtScheme<vector>::typeName == fv::CrankNicolsonDdtScheme<vector>::typeName
) )
{ {
sweptVolCorr *= (1.0/2.0)*DB().deltaT().value(); sweptVolCorr *= (1.0/2.0)*DB().deltaT().value();

View file

@ -328,7 +328,7 @@ $(ddtSchemes)/SLTSDdtScheme/SLTSDdtSchemes.C
$(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C $(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C $(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C
$(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C $(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C
$(ddtSchemes)/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C $(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C
$(ddtSchemes)/steadyInertialDdtScheme/steadyInertialDdtSchemes.C $(ddtSchemes)/steadyInertialDdtScheme/steadyInertialDdtSchemes.C
d2dt2Schemes = finiteVolume/d2dt2Schemes d2dt2Schemes = finiteVolume/d2dt2Schemes

View file

@ -28,7 +28,7 @@ License
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "EulerDdtScheme.H" #include "EulerDdtScheme.H"
#include "CrankNicholsonDdtScheme.H" #include "CrankNicolsonDdtScheme.H"
#include "backwardDdtScheme.H" #include "backwardDdtScheme.H"
#include "steadyStateDdtScheme.H" #include "steadyStateDdtScheme.H"
@ -270,7 +270,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
if if
( (
ddtScheme == fv::EulerDdtScheme<Type>::typeName ddtScheme == fv::EulerDdtScheme<Type>::typeName
|| ddtScheme == fv::CrankNicholsonDdtScheme<Type>::typeName || ddtScheme == fv::CrankNicolsonDdtScheme<Type>::typeName
) )
{ {
this->refValue() = this->refValue() =
@ -318,7 +318,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
if if
( (
ddtScheme == fv::EulerDdtScheme<Type>::typeName ddtScheme == fv::EulerDdtScheme<Type>::typeName
|| ddtScheme == fv::CrankNicholsonDdtScheme<Type>::typeName || ddtScheme == fv::CrankNicolsonDdtScheme<Type>::typeName
) )
{ {
this->refValue() = field.oldTime().boundaryField()[patchi]; this->refValue() = field.oldTime().boundaryField()[patchi];

View file

@ -28,7 +28,7 @@ Description
Advective outflow boundary condition based on solving DDt(psi, U) = 0 Advective outflow boundary condition based on solving DDt(psi, U) = 0
at the boundary. at the boundary.
The standard (Euler, backward, CrankNicholson) time schemes are The standard (Euler, backward, CrankNicolson) time schemes are
supported. Additionally an optional mechanism to relax the value at supported. Additionally an optional mechanism to relax the value at
the boundary to a specified far-field value is provided which is the boundary to a specified far-field value is provided which is
switched on by specifying the relaxation length-scale lInf and the switched on by specifying the relaxation length-scale lInf and the

View file

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "CrankNicholsonDdtScheme.H" #include "CrankNicolsonDdtScheme.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "fvcDiv.H" #include "fvcDiv.H"
#include "fvMatrices.H" #include "fvMatrices.H"
@ -42,7 +42,7 @@ namespace fv
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field
( (
const IOobject& io, const IOobject& io,
const fvMesh& mesh const fvMesh& mesh
@ -60,7 +60,7 @@ CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field
( (
const IOobject& io, const IOobject& io,
const fvMesh& mesh, const fvMesh& mesh,
@ -74,7 +74,7 @@ CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>::DDt0Field
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
label CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>:: label CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>::
startTimeIndex() const startTimeIndex() const
{ {
return startTimeIndex_; return startTimeIndex_;
@ -83,7 +83,7 @@ startTimeIndex() const
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
GeoField& CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>:: GeoField& CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>::
operator()() operator()()
{ {
return *this; return *this;
@ -92,7 +92,7 @@ operator()()
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
void CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>:: void CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>::
operator=(const GeoField& gf) operator=(const GeoField& gf)
{ {
GeoField::operator=(gf); GeoField::operator=(gf);
@ -101,8 +101,8 @@ operator=(const GeoField& gf)
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
CrankNicholsonDdtScheme<Type>::DDt0Field<GeoField>& CrankNicolsonDdtScheme<Type>::DDt0Field<GeoField>&
CrankNicholsonDdtScheme<Type>::ddt0_ CrankNicolsonDdtScheme<Type>::ddt0_
( (
const word& name, const word& name,
const dimensionSet& dims const dimensionSet& dims
@ -183,7 +183,7 @@ CrankNicholsonDdtScheme<Type>::ddt0_
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
bool CrankNicholsonDdtScheme<Type>::evaluate bool CrankNicolsonDdtScheme<Type>::evaluate
( (
const DDt0Field<GeoField>& ddt0 const DDt0Field<GeoField>& ddt0
) const ) const
@ -193,7 +193,7 @@ bool CrankNicholsonDdtScheme<Type>::evaluate
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
scalar CrankNicholsonDdtScheme<Type>::coef_ scalar CrankNicolsonDdtScheme<Type>::coef_
( (
const DDt0Field<GeoField>& ddt0 const DDt0Field<GeoField>& ddt0
) const ) const
@ -211,7 +211,7 @@ scalar CrankNicholsonDdtScheme<Type>::coef_
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
scalar CrankNicholsonDdtScheme<Type>::coef0_ scalar CrankNicolsonDdtScheme<Type>::coef0_
( (
const DDt0Field<GeoField>& ddt0 const DDt0Field<GeoField>& ddt0
) const ) const
@ -229,7 +229,7 @@ scalar CrankNicholsonDdtScheme<Type>::coef0_
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
dimensionedScalar CrankNicholsonDdtScheme<Type>::rDtCoef_ dimensionedScalar CrankNicolsonDdtScheme<Type>::rDtCoef_
( (
const DDt0Field<GeoField>& ddt0 const DDt0Field<GeoField>& ddt0
) const ) const
@ -240,7 +240,7 @@ dimensionedScalar CrankNicholsonDdtScheme<Type>::rDtCoef_
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
dimensionedScalar CrankNicholsonDdtScheme<Type>::rDtCoef0_ dimensionedScalar CrankNicolsonDdtScheme<Type>::rDtCoef0_
( (
const DDt0Field<GeoField>& ddt0 const DDt0Field<GeoField>& ddt0
) const ) const
@ -251,7 +251,7 @@ dimensionedScalar CrankNicholsonDdtScheme<Type>::rDtCoef0_
template<class Type> template<class Type>
template<class GeoField> template<class GeoField>
tmp<GeoField> CrankNicholsonDdtScheme<Type>::offCentre_ tmp<GeoField> CrankNicolsonDdtScheme<Type>::offCentre_
( (
const GeoField& ddt0 const GeoField& ddt0
) const ) const
@ -281,7 +281,7 @@ const FieldField<fvPatchField, Type>& ff
template<class Type> template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > tmp<GeometricField<Type, fvPatchField, volMesh> >
CrankNicholsonDdtScheme<Type>::fvcDdt CrankNicolsonDdtScheme<Type>::fvcDdt
( (
const dimensioned<Type>& dt const dimensioned<Type>& dt
) )
@ -343,7 +343,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdt
template<class Type> template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > tmp<GeometricField<Type, fvPatchField, volMesh> >
CrankNicholsonDdtScheme<Type>::fvcDdt CrankNicolsonDdtScheme<Type>::fvcDdt
( (
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
@ -432,7 +432,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdt
template<class Type> template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > tmp<GeometricField<Type, fvPatchField, volMesh> >
CrankNicholsonDdtScheme<Type>::fvcDdt CrankNicolsonDdtScheme<Type>::fvcDdt
( (
const dimensionedScalar& rho, const dimensionedScalar& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
@ -522,7 +522,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdt
template<class Type> template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > tmp<GeometricField<Type, fvPatchField, volMesh> >
CrankNicholsonDdtScheme<Type>::fvcDdt CrankNicolsonDdtScheme<Type>::fvcDdt
( (
const volScalarField& rho, const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
@ -622,7 +622,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdt
template<class Type> template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
CrankNicholsonDdtScheme<Type>::fvmDdt CrankNicolsonDdtScheme<Type>::fvmDdt
( (
GeometricField<Type, fvPatchField, volMesh>& vf GeometricField<Type, fvPatchField, volMesh>& vf
) )
@ -705,7 +705,7 @@ CrankNicholsonDdtScheme<Type>::fvmDdt
template<class Type> template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
CrankNicholsonDdtScheme<Type>::fvmDdt CrankNicolsonDdtScheme<Type>::fvmDdt
( (
const dimensionedScalar& rho, const dimensionedScalar& rho,
GeometricField<Type, fvPatchField, volMesh>& vf GeometricField<Type, fvPatchField, volMesh>& vf
@ -787,7 +787,7 @@ CrankNicholsonDdtScheme<Type>::fvmDdt
template<class Type> template<class Type>
tmp<fvMatrix<Type> > tmp<fvMatrix<Type> >
CrankNicholsonDdtScheme<Type>::fvmDdt CrankNicolsonDdtScheme<Type>::fvmDdt
( (
const volScalarField& rho, const volScalarField& rho,
GeometricField<Type, fvPatchField, volMesh>& vf GeometricField<Type, fvPatchField, volMesh>& vf
@ -849,7 +849,7 @@ CrankNicholsonDdtScheme<Type>::fvmDdt
fvm.source() = fvm.source() =
( (
rDtCoef*rho.internalField()*vf.oldTime().internalField() rDtCoef*rho.oldTime().internalField()*vf.oldTime().internalField()
+ offCentre_(ddt0.internalField()) + offCentre_(ddt0.internalField())
)*mesh().V0(); )*mesh().V0();
} }
@ -877,8 +877,8 @@ CrankNicholsonDdtScheme<Type>::fvmDdt
template<class Type> template<class Type>
tmp<typename CrankNicholsonDdtScheme<Type>::fluxFieldType> tmp<typename CrankNicolsonDdtScheme<Type>::fluxFieldType>
CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr
( (
const volScalarField& rA, const volScalarField& rA,
const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField<Type, fvPatchField, volMesh>& U,
@ -964,8 +964,8 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr
template<class Type> template<class Type>
tmp<typename CrankNicholsonDdtScheme<Type>::fluxFieldType> tmp<typename CrankNicolsonDdtScheme<Type>::fluxFieldType>
CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr
( (
const volScalarField& rA, const volScalarField& rA,
const volScalarField& rho, const volScalarField& rho,
@ -1157,7 +1157,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr
{ {
FatalErrorIn FatalErrorIn
( (
"CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr" "CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr"
) << "dimensions of phi are not correct" ) << "dimensions of phi are not correct"
<< abort(FatalError); << abort(FatalError);
@ -1168,7 +1168,7 @@ CrankNicholsonDdtScheme<Type>::fvcDdtPhiCorr
template<class Type> template<class Type>
tmp<surfaceScalarField> CrankNicholsonDdtScheme<Type>::meshPhi tmp<surfaceScalarField> CrankNicolsonDdtScheme<Type>::meshPhi
( (
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) )
@ -1185,7 +1185,22 @@ tmp<surfaceScalarField> CrankNicholsonDdtScheme<Type>::meshPhi
coef0_(meshPhi0)*mesh().phi().oldTime() - offCentre_(meshPhi0()); coef0_(meshPhi0)*mesh().phi().oldTime() - offCentre_(meshPhi0());
} }
return coef_(meshPhi0)*mesh().phi() - offCentre_(meshPhi0()); return tmp<surfaceScalarField>
(
new surfaceScalarField
(
IOobject
(
mesh().phi().name(),
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
coef_(meshPhi0)*mesh().phi() - offCentre_(meshPhi0())
)
);
} }

View file

@ -22,19 +22,19 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>. along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::fv::CrankNicholsonDdtScheme Foam::fv::CrankNicolsonDdtScheme
Description Description
Second-oder CrankNicholson implicit ddt using the current and Second-oder CrankNicolson implicit ddt using the current and
previous time-step fields as well as the previous time-step ddt. previous time-step fields as well as the previous time-step ddt.
SourceFiles SourceFiles
CrankNicholsonDdtScheme.C CrankNicolsonDdtScheme.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef CrankNicholsonDdtScheme_H #ifndef CrankNicolsonDdtScheme_H
#define CrankNicholsonDdtScheme_H #define CrankNicolsonDdtScheme_H
#include "ddtScheme.H" #include "ddtScheme.H"
@ -49,11 +49,11 @@ namespace fv
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class CrankNicholsonDdtScheme Declaration Class CrankNicolsonDdtScheme Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class Type> template<class Type>
class CrankNicholsonDdtScheme class CrankNicolsonDdtScheme
: :
public fv::ddtScheme<Type> public fv::ddtScheme<Type>
{ {
@ -105,10 +105,10 @@ class CrankNicholsonDdtScheme
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
CrankNicholsonDdtScheme(const CrankNicholsonDdtScheme&); CrankNicolsonDdtScheme(const CrankNicolsonDdtScheme&);
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const CrankNicholsonDdtScheme&); void operator=(const CrankNicolsonDdtScheme&);
template<class GeoField> template<class GeoField>
DDt0Field<GeoField>& ddt0_ DDt0Field<GeoField>& ddt0_
@ -149,20 +149,20 @@ class CrankNicholsonDdtScheme
public: public:
//- Runtime type information //- Runtime type information
TypeName("CrankNicholson"); TypeName("CrankNicolson");
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh
CrankNicholsonDdtScheme(const fvMesh& mesh) CrankNicolsonDdtScheme(const fvMesh& mesh)
: :
ddtScheme<Type>(mesh), ddtScheme<Type>(mesh),
ocCoeff_(1.0) ocCoeff_(1.0)
{} {}
//- Construct from mesh and Istream //- Construct from mesh and Istream
CrankNicholsonDdtScheme(const fvMesh& mesh, Istream& is) CrankNicolsonDdtScheme(const fvMesh& mesh, Istream& is)
: :
ddtScheme<Type>(mesh, is), ddtScheme<Type>(mesh, is),
ocCoeff_(readScalar(is)) ocCoeff_(readScalar(is))
@ -171,7 +171,7 @@ public:
{ {
FatalIOErrorIn FatalIOErrorIn
( (
"CrankNicholsonDdtScheme(const fvMesh& mesh, Istream& is)", "CrankNicolsonDdtScheme(const fvMesh& mesh, Istream& is)",
is is
) << "coefficient = " << ocCoeff_ ) << "coefficient = " << ocCoeff_
<< " should be >= 0 and <= 1" << " should be >= 0 and <= 1"
@ -253,7 +253,7 @@ public:
template<> template<>
tmp<surfaceScalarField> CrankNicholsonDdtScheme<scalar>::fvcDdtPhiCorr tmp<surfaceScalarField> CrankNicolsonDdtScheme<scalar>::fvcDdtPhiCorr
( (
const volScalarField& rA, const volScalarField& rA,
const volScalarField& U, const volScalarField& U,
@ -262,7 +262,7 @@ tmp<surfaceScalarField> CrankNicholsonDdtScheme<scalar>::fvcDdtPhiCorr
template<> template<>
tmp<surfaceScalarField> CrankNicholsonDdtScheme<scalar>::fvcDdtPhiCorr tmp<surfaceScalarField> CrankNicolsonDdtScheme<scalar>::fvcDdtPhiCorr
( (
const volScalarField& rA, const volScalarField& rA,
const volScalarField& rho, const volScalarField& rho,
@ -282,7 +282,7 @@ tmp<surfaceScalarField> CrankNicholsonDdtScheme<scalar>::fvcDdtPhiCorr
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "CrankNicholsonDdtScheme.C" # include "CrankNicolsonDdtScheme.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -25,7 +25,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "CrankNicholsonDdtScheme.H" #include "CrankNicolsonDdtScheme.H"
#include "fvMesh.H" #include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -34,7 +34,7 @@ namespace Foam
{ {
namespace fv namespace fv
{ {
makeFvDdtScheme(CrankNicholsonDdtScheme) makeFvDdtScheme(CrankNicolsonDdtScheme)
} }
} }

View file

@ -16,7 +16,7 @@ FoamFile
ddtSchemes ddtSchemes
{ {
default CrankNicholson 0.9; default CrankNicolson 0.9;
} }
gradSchemes gradSchemes