From b2d3172e529d25f6711f308fc8ad2f7537d473a5 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Mon, 23 Jan 2017 08:32:32 +0100 Subject: [PATCH] fvcConsistentDdtPhiCorr for ddtSchemes in dbns library --- .../EulerLocalDdtScheme/EulerLocalDdtScheme.C | 24 ++++++++++++++++++ .../EulerLocalDdtScheme/EulerLocalDdtScheme.H | 19 ++++++++++++++ .../backwardDualDdtScheme.C | 25 +++++++++++++++++++ .../backwardDualDdtScheme.H | 18 +++++++++++++ 4 files changed, 86 insertions(+) diff --git a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C index 229eb40cf..e039915e5 100644 --- a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C +++ b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C @@ -624,6 +624,30 @@ EulerLocalDdtScheme::fvcDdtPhiCorr } +template +tmp::fluxFieldType> +EulerLocalDdtScheme::fvcDdtConsistentPhiCorr +( + const GeometricField& faceU, + const GeometricField& U, + const surfaceScalarField& rAUf +) +{ + const objectRegistry& registry = this->mesh(); + + // Get access to the scalar beta[i] + const scalarField& beta = + registry.lookupObject(deltaTName_); + + const surfaceScalarField rDeltaTf = fvc::interpolate + ( + 1.0/(beta[0]*registry.lookupObject(deltaTauName_)) + ); + + return (mesh().Sf() & faceU.oldTime())*rAUf*rDeltaTf; +} + + template tmp EulerLocalDdtScheme::meshPhi ( diff --git a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H index 147162553..0af5365fb 100644 --- a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H +++ b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H @@ -165,6 +165,16 @@ public: const fluxFieldType& phi ); + + // Member functions for the new time consistent formulation + tmp fvcDdtConsistentPhiCorr + ( + const GeometricField& faceU, + const GeometricField& U, + const surfaceScalarField& rAUf + ); + + tmp meshPhi ( const GeometricField& @@ -191,6 +201,15 @@ tmp EulerLocalDdtScheme::fvcDdtPhiCorr ); +template<> +tmp EulerLocalDdtScheme::fvcDdtConsistentPhiCorr +( + const surfaceScalarField& faceU, + const volScalarField& U, + const surfaceScalarField& rAUf +); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fv diff --git a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C index 9195a71da..0d18bc73f 100644 --- a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C +++ b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C @@ -840,6 +840,31 @@ backwardDualDdtScheme::fvcDdtPhiCorr } +template +tmp::fluxFieldType> +backwardDualDdtScheme::fvcDdtConsistentPhiCorr +( + const GeometricField& faceU, + const GeometricField& U, + const surfaceScalarField& rAUf +) +{ + notImplemented + ( + type() + + "::fvcDdtConsistentPhiCorr" + + "\n(" + + "\n const GeometricField& faceU," + + "\n const GeometricField& U" + + "\n const surfaceScalarField rAUf" + + "\n)" + ); + + // Dummy return + return tmp(NULL); +} + + template tmp backwardDualDdtScheme::meshPhi ( diff --git a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H index 25ad31ba5..c1647f783 100644 --- a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H +++ b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H @@ -198,6 +198,15 @@ public: ); + // Member functions for the new time consistent formulation + tmp fvcDdtConsistentPhiCorr + ( + const GeometricField& faceU, + const GeometricField& U, + const surfaceScalarField& rAUf + ); + + tmp meshPhi ( const GeometricField& @@ -224,6 +233,15 @@ tmp backwardDualDdtScheme::fvcDdtPhiCorr ); +template<> +tmp backwardDualDdtScheme::fvcDdtConsistentPhiCorr +( + const surfaceScalarField& faceU, + const volScalarField& U, + const surfaceScalarField& rAUf +); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fv