From 3f2807735ddde2cb88c779e74d1ee21f32effa1e Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 23 Apr 2015 15:22:00 +0100 Subject: [PATCH] Renamed CrankNicolson scheme: correct spelling --- .../surfaceTracking/freeSurface/freeSurface.C | 6 +- src/finiteVolume/Make/files | 2 +- .../derived/advective/advectiveFvPatchField.C | 6 +- .../derived/advective/advectiveFvPatchField.H | 2 +- .../CrankNicolsonDdtScheme.C} | 73 +++++++++++-------- .../CrankNicolsonDdtScheme.H} | 32 ++++---- .../CrankNicolsonDdtSchemes.C} | 4 +- .../squareBump/system/fvSchemes | 2 +- 8 files changed, 71 insertions(+), 56 deletions(-) rename src/finiteVolume/finiteVolume/ddtSchemes/{CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C => CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C} (94%) rename src/finiteVolume/finiteVolume/ddtSchemes/{CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H => CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H} (90%) rename src/finiteVolume/finiteVolume/ddtSchemes/{CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C => CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C} (94%) diff --git a/applications/solvers/surfaceTracking/freeSurface/freeSurface.C b/applications/solvers/surfaceTracking/freeSurface/freeSurface.C index d820ac29f..6973a1710 100644 --- a/applications/solvers/surfaceTracking/freeSurface/freeSurface.C +++ b/applications/solvers/surfaceTracking/freeSurface/freeSurface.C @@ -35,7 +35,7 @@ Description #include "wallFvPatch.H" #include "EulerDdtScheme.H" -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "backwardDdtScheme.H" #include "tetFemMatrices.H" @@ -480,7 +480,7 @@ bool freeSurface::movePoints(const scalarField& interfacePhi) if ( ddtScheme - == fv::CrankNicholsonDdtScheme::typeName + == fv::CrankNicolsonDdtScheme::typeName ) { sweptVolCorr *= (1.0/2.0)*DB().deltaT().value(); @@ -890,7 +890,7 @@ bool freeSurface::moveMeshPoints() if ( ddtScheme - == fv::CrankNicholsonDdtScheme::typeName + == fv::CrankNicolsonDdtScheme::typeName ) { sweptVolCorr *= (1.0/2.0)*DB().deltaT().value(); diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 81460199b..00a544363 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -328,7 +328,7 @@ $(ddtSchemes)/SLTSDdtScheme/SLTSDdtSchemes.C $(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C $(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C $(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C -$(ddtSchemes)/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C +$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C $(ddtSchemes)/steadyInertialDdtScheme/steadyInertialDdtSchemes.C d2dt2Schemes = finiteVolume/d2dt2Schemes diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index c7461f8cd..da1814f0e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -28,7 +28,7 @@ License #include "fvPatchFieldMapper.H" #include "volFields.H" #include "EulerDdtScheme.H" -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "backwardDdtScheme.H" #include "steadyStateDdtScheme.H" @@ -270,7 +270,7 @@ void advectiveFvPatchField::updateCoeffs() if ( ddtScheme == fv::EulerDdtScheme::typeName - || ddtScheme == fv::CrankNicholsonDdtScheme::typeName + || ddtScheme == fv::CrankNicolsonDdtScheme::typeName ) { this->refValue() = @@ -318,7 +318,7 @@ void advectiveFvPatchField::updateCoeffs() if ( ddtScheme == fv::EulerDdtScheme::typeName - || ddtScheme == fv::CrankNicholsonDdtScheme::typeName + || ddtScheme == fv::CrankNicolsonDdtScheme::typeName ) { this->refValue() = field.oldTime().boundaryField()[patchi]; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H index c6a814e7f..2963b1727 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H @@ -28,7 +28,7 @@ Description Advective outflow boundary condition based on solving DDt(psi, U) = 0 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 the boundary to a specified far-field value is provided which is switched on by specifying the relaxation length-scale lInf and the diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C similarity index 94% rename from src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C rename to src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C index 95943e5a4..781ad3dc4 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" #include "fvMatrices.H" @@ -42,7 +42,7 @@ namespace fv template template -CrankNicholsonDdtScheme::DDt0Field::DDt0Field +CrankNicolsonDdtScheme::DDt0Field::DDt0Field ( const IOobject& io, const fvMesh& mesh @@ -60,7 +60,7 @@ CrankNicholsonDdtScheme::DDt0Field::DDt0Field template template -CrankNicholsonDdtScheme::DDt0Field::DDt0Field +CrankNicolsonDdtScheme::DDt0Field::DDt0Field ( const IOobject& io, const fvMesh& mesh, @@ -74,7 +74,7 @@ CrankNicholsonDdtScheme::DDt0Field::DDt0Field template template -label CrankNicholsonDdtScheme::DDt0Field:: +label CrankNicolsonDdtScheme::DDt0Field:: startTimeIndex() const { return startTimeIndex_; @@ -83,7 +83,7 @@ startTimeIndex() const template template -GeoField& CrankNicholsonDdtScheme::DDt0Field:: +GeoField& CrankNicolsonDdtScheme::DDt0Field:: operator()() { return *this; @@ -92,7 +92,7 @@ operator()() template template -void CrankNicholsonDdtScheme::DDt0Field:: +void CrankNicolsonDdtScheme::DDt0Field:: operator=(const GeoField& gf) { GeoField::operator=(gf); @@ -101,8 +101,8 @@ operator=(const GeoField& gf) template template -CrankNicholsonDdtScheme::DDt0Field& -CrankNicholsonDdtScheme::ddt0_ +CrankNicolsonDdtScheme::DDt0Field& +CrankNicolsonDdtScheme::ddt0_ ( const word& name, const dimensionSet& dims @@ -183,7 +183,7 @@ CrankNicholsonDdtScheme::ddt0_ template template -bool CrankNicholsonDdtScheme::evaluate +bool CrankNicolsonDdtScheme::evaluate ( const DDt0Field& ddt0 ) const @@ -193,7 +193,7 @@ bool CrankNicholsonDdtScheme::evaluate template template -scalar CrankNicholsonDdtScheme::coef_ +scalar CrankNicolsonDdtScheme::coef_ ( const DDt0Field& ddt0 ) const @@ -211,7 +211,7 @@ scalar CrankNicholsonDdtScheme::coef_ template template -scalar CrankNicholsonDdtScheme::coef0_ +scalar CrankNicolsonDdtScheme::coef0_ ( const DDt0Field& ddt0 ) const @@ -229,7 +229,7 @@ scalar CrankNicholsonDdtScheme::coef0_ template template -dimensionedScalar CrankNicholsonDdtScheme::rDtCoef_ +dimensionedScalar CrankNicolsonDdtScheme::rDtCoef_ ( const DDt0Field& ddt0 ) const @@ -240,7 +240,7 @@ dimensionedScalar CrankNicholsonDdtScheme::rDtCoef_ template template -dimensionedScalar CrankNicholsonDdtScheme::rDtCoef0_ +dimensionedScalar CrankNicolsonDdtScheme::rDtCoef0_ ( const DDt0Field& ddt0 ) const @@ -251,7 +251,7 @@ dimensionedScalar CrankNicholsonDdtScheme::rDtCoef0_ template template -tmp CrankNicholsonDdtScheme::offCentre_ +tmp CrankNicolsonDdtScheme::offCentre_ ( const GeoField& ddt0 ) const @@ -281,7 +281,7 @@ const FieldField& ff template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const dimensioned& dt ) @@ -343,7 +343,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const GeometricField& vf ) @@ -432,7 +432,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const dimensionedScalar& rho, const GeometricField& vf @@ -522,7 +522,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const volScalarField& rho, const GeometricField& vf @@ -622,7 +622,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvmDdt +CrankNicolsonDdtScheme::fvmDdt ( GeometricField& vf ) @@ -705,7 +705,7 @@ CrankNicholsonDdtScheme::fvmDdt template tmp > -CrankNicholsonDdtScheme::fvmDdt +CrankNicolsonDdtScheme::fvmDdt ( const dimensionedScalar& rho, GeometricField& vf @@ -787,7 +787,7 @@ CrankNicholsonDdtScheme::fvmDdt template tmp > -CrankNicholsonDdtScheme::fvmDdt +CrankNicolsonDdtScheme::fvmDdt ( const volScalarField& rho, GeometricField& vf @@ -849,7 +849,7 @@ CrankNicholsonDdtScheme::fvmDdt fvm.source() = ( - rDtCoef*rho.internalField()*vf.oldTime().internalField() + rDtCoef*rho.oldTime().internalField()*vf.oldTime().internalField() + offCentre_(ddt0.internalField()) )*mesh().V0(); } @@ -877,8 +877,8 @@ CrankNicholsonDdtScheme::fvmDdt template -tmp::fluxFieldType> -CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp::fluxFieldType> +CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const GeometricField& U, @@ -964,8 +964,8 @@ CrankNicholsonDdtScheme::fvcDdtPhiCorr template -tmp::fluxFieldType> -CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp::fluxFieldType> +CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& rho, @@ -1157,7 +1157,7 @@ CrankNicholsonDdtScheme::fvcDdtPhiCorr { FatalErrorIn ( - "CrankNicholsonDdtScheme::fvcDdtPhiCorr" + "CrankNicolsonDdtScheme::fvcDdtPhiCorr" ) << "dimensions of phi are not correct" << abort(FatalError); @@ -1168,7 +1168,7 @@ CrankNicholsonDdtScheme::fvcDdtPhiCorr template -tmp CrankNicholsonDdtScheme::meshPhi +tmp CrankNicolsonDdtScheme::meshPhi ( const GeometricField& vf ) @@ -1185,7 +1185,22 @@ tmp CrankNicholsonDdtScheme::meshPhi coef0_(meshPhi0)*mesh().phi().oldTime() - offCentre_(meshPhi0()); } - return coef_(meshPhi0)*mesh().phi() - offCentre_(meshPhi0()); + return tmp + ( + new surfaceScalarField + ( + IOobject + ( + mesh().phi().name(), + mesh().time().timeName(), + mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + coef_(meshPhi0)*mesh().phi() - offCentre_(meshPhi0()) + ) + ); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H similarity index 90% rename from src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H rename to src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H index 3376a4786..7ed4c0e6d 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H @@ -22,19 +22,19 @@ License along with foam-extend. If not, see . Class - Foam::fv::CrankNicholsonDdtScheme + Foam::fv::CrankNicolsonDdtScheme 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. SourceFiles - CrankNicholsonDdtScheme.C + CrankNicolsonDdtScheme.C \*---------------------------------------------------------------------------*/ -#ifndef CrankNicholsonDdtScheme_H -#define CrankNicholsonDdtScheme_H +#ifndef CrankNicolsonDdtScheme_H +#define CrankNicolsonDdtScheme_H #include "ddtScheme.H" @@ -49,11 +49,11 @@ namespace fv { /*---------------------------------------------------------------------------*\ - Class CrankNicholsonDdtScheme Declaration + Class CrankNicolsonDdtScheme Declaration \*---------------------------------------------------------------------------*/ template -class CrankNicholsonDdtScheme +class CrankNicolsonDdtScheme : public fv::ddtScheme { @@ -105,10 +105,10 @@ class CrankNicholsonDdtScheme // Private Member Functions //- Disallow default bitwise copy construct - CrankNicholsonDdtScheme(const CrankNicholsonDdtScheme&); + CrankNicolsonDdtScheme(const CrankNicolsonDdtScheme&); //- Disallow default bitwise assignment - void operator=(const CrankNicholsonDdtScheme&); + void operator=(const CrankNicolsonDdtScheme&); template DDt0Field& ddt0_ @@ -149,20 +149,20 @@ class CrankNicholsonDdtScheme public: //- Runtime type information - TypeName("CrankNicholson"); + TypeName("CrankNicolson"); // Constructors //- Construct from mesh - CrankNicholsonDdtScheme(const fvMesh& mesh) + CrankNicolsonDdtScheme(const fvMesh& mesh) : ddtScheme(mesh), ocCoeff_(1.0) {} //- Construct from mesh and Istream - CrankNicholsonDdtScheme(const fvMesh& mesh, Istream& is) + CrankNicolsonDdtScheme(const fvMesh& mesh, Istream& is) : ddtScheme(mesh, is), ocCoeff_(readScalar(is)) @@ -171,7 +171,7 @@ public: { FatalIOErrorIn ( - "CrankNicholsonDdtScheme(const fvMesh& mesh, Istream& is)", + "CrankNicolsonDdtScheme(const fvMesh& mesh, Istream& is)", is ) << "coefficient = " << ocCoeff_ << " should be >= 0 and <= 1" @@ -253,7 +253,7 @@ public: template<> -tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& U, @@ -262,7 +262,7 @@ tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr template<> -tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& rho, @@ -282,7 +282,7 @@ tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "CrankNicholsonDdtScheme.C" +# include "CrankNicolsonDdtScheme.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C similarity index 94% rename from src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C rename to src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C index 5c1ea9a5c..b154fc37c 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C @@ -25,7 +25,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -34,7 +34,7 @@ namespace Foam { namespace fv { - makeFvDdtScheme(CrankNicholsonDdtScheme) + makeFvDdtScheme(CrankNicolsonDdtScheme) } } diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes index e584345e7..e7094ab12 100644 --- a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes @@ -16,7 +16,7 @@ FoamFile ddtSchemes { - default CrankNicholson 0.9; + default CrankNicolson 0.9; } gradSchemes