View Issue Details

IDProjectCategoryView StatusLast Update
0003208OpenFOAMBugpublic2019-03-27 16:31
Reporterkevnor Assigned Tohenry  
Status resolvedResolutionfixed 
Fixed in Versiondev 
Summary0003208: FPE in dynamicKEqn model on restart
Description(also present in dev)

Depending on the velocity field, starting / resuming a simulation using the dynamicKEqn turbulence model can result in a FPE due to negative values of the KK field created in ::correctNut(). I believe it should have an enforced minimum value, similar to the calls via ::Ce() and ::correct().

I've attached a suitable patch for openfoam-dev.
TagsNo tags attached.



2019-03-27 14:25


dynamicKEqn.patch (738 bytes)   
diff --git src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C
index 02936f0db..dbee2a94d 100644
--- src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C
+++ src/TurbulenceModels/turbulenceModels/LES/dynamicKEqn/dynamicKEqn.C
@@ -117,10 +117,11 @@ void dynamicKEqn<BasicTurbulenceModel>::correctNut
 template<class BasicTurbulenceModel>
 void dynamicKEqn<BasicTurbulenceModel>::correctNut()
-    const volScalarField KK
+    volScalarField KK
         0.5*(filter_(magSqr(this->U_)) - magSqr(filter_(this->U_)))
+    KK.max(dimensionedScalar(KK.dimensions(), small));
     correctNut(symm(fvc::grad(this->U_)), KK);
dynamicKEqn.patch (738 bytes)   


2019-03-27 16:31

manager   ~0010399

Thanks for the report. I have rationalized the calculation of KK and created a KK() function to avoid the code duplication and potential errors this often leads to.

Fixed in OpenFOAM-dev by commit 87d3d2d3d0d9cbc98fb2b6644b262009c85a77f4

Issue History

Date Modified Username Field Change
2019-03-27 14:25 kevnor New Issue
2019-03-27 14:25 kevnor File Added: dynamicKEqn.patch
2019-03-27 16:31 henry Assigned To => henry
2019-03-27 16:31 henry Status new => resolved
2019-03-27 16:31 henry Resolution open => fixed
2019-03-27 16:31 henry Fixed in Version => dev
2019-03-27 16:31 henry Note Added: 0010399