BUG: Correction to commit 8540e6f

- corrected the mass based correction and updated the misleading function
  arguments

- moved the option to the optimisation switches, e.g.:

    OptimisationSwitches
    {
        experimentalDdtCorr 1;
    }

- default remains off/no (0)
This commit is contained in:
Andrew Heather
2018-06-18 14:13:12 +01:00
parent 601ebaa919
commit dad09c5e7d
4 changed files with 13 additions and 8 deletions

View File

@ -129,6 +129,11 @@ OptimisationSwitches
//- Choose STL ASCII parser: 0=Flex, 1=Ragel, 2=Manual //- Choose STL ASCII parser: 0=Flex, 1=Ragel, 2=Manual
fileFormats::stl 0; fileFormats::stl 0;
//- Use the updated ddt correction formulation introduced by openfoam org
// in commit da787200. Default is to use the formulation from v1712
// see ddtScheme.C
experimentalDdtCorr 0;
} }

View File

@ -353,7 +353,7 @@ tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff
template<class Type> template<class Type>
tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff
( (
const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField<Type, fvPatchField, volMesh>& rhoU,
const fluxFieldType& phi, const fluxFieldType& phi,
const volScalarField& rho const volScalarField& rho
) )
@ -362,9 +362,9 @@ tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff
{ {
return fvcDdtPhiCoeffExperimental return fvcDdtPhiCoeffExperimental
( (
U, rhoU,
phi, phi,
(phi - fvc::dotInterpolate(mesh().Sf(), rho*U)) (phi - fvc::dotInterpolate(mesh().Sf(), rhoU))
/fvc::interpolate(rho) /fvc::interpolate(rho)
); );
} }
@ -372,9 +372,9 @@ tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff
{ {
return fvcDdtPhiCoeff return fvcDdtPhiCoeff
( (
U, rhoU,
phi, phi,
(phi - fvc::dotInterpolate(mesh().Sf(), rho*U)) (phi - fvc::dotInterpolate(mesh().Sf(), rhoU))
); );
} }
} }

View File

@ -257,7 +257,7 @@ public:
tmp<surfaceScalarField> fvcDdtPhiCoeff tmp<surfaceScalarField> fvcDdtPhiCoeff
( (
const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField<Type, fvPatchField, volMesh>& rhoU,
const fluxFieldType& phi, const fluxFieldType& phi,
const volScalarField& rho const volScalarField& rho
); );

View File

@ -31,10 +31,10 @@ License
bool Foam::fv::ddtSchemeBase::experimentalDdtCorr bool Foam::fv::ddtSchemeBase::experimentalDdtCorr
( (
Foam::debug::infoSwitch("experimentalDdtCorr", 0) Foam::debug::optimisationSwitch("experimentalDdtCorr", 0)
); );
registerInfoSwitch registerOptSwitch
( (
"experimentalDdtCorr", "experimentalDdtCorr",
bool, bool,