staneuski / dualFuelEngine

OpenFOAM solver based on phenomenological compression model for dual-fuel marine engines
GNU Affero General Public License v3.0
13 stars 3 forks source link

Unstable solution when solving RiemannTube case #7

Closed staneuski closed 5 years ago

staneuski commented 5 years ago

issue7

staneuski commented 5 years ago

Change fvSchemes:

diff --git a/tutorials/multiCompression/RiemannTube/system/fvSchemes b/tutorials/multiCompression/RiemannTube/system/fvSchemes
index 55501e6..d1ad001 100755
--- a/tutorials/multiCompression/RiemannTube/system/fvSchemes
+++ b/tutorials/multiCompression/RiemannTube/system/fvSchemes
@@ -23,11 +23,14 @@ ddtSchemes
 gradSchemes
 {
     default         Gauss linear;
+   grad(p)         cellLimited Gauss linear 0.9; // UEqn
 }

 divSchemes
 {
-    default         Gauss linear;
+    default         Gauss cubic;
+   div(phi,U)      Gauss upwind; // UEqn
+   div(phi,e)      Gauss upwind; // eEqn
 }

 laplacianSchemes
@@ -37,7 +40,7 @@ laplacianSchemes

 interpolationSchemes
 {
-    default         linear;
+    default         cubic;
 }

 snGradSchemes
@@ -45,5 +48,4 @@ snGradSchemes
     default         corrected;
 }

And then result will be something like: fvSchemes-Closes#7

staneuski commented 5 years ago

Change explicit to implicit for eEqn in the solver [ commit af3371a ]:


- For [**createFields.H**](https://github.com/StasF1/dualFuelEngine/blob/v0.2-alpha/solvers/multiCompression/createFields.H):
```diff
@@ -114,7 +114,21 @@ surfaceScalarField phi
    fvc::flux(rho*U)
 );

-Info<< "Constructing energy field" << endl;
+wordList eBCTypes
+(
+    U.boundaryField().size(),
+    fixedValueFvPatchScalarField::typeName
+);
+
+forAll(U.boundaryField(), patchi)
+{
+    if (U.boundaryField()[patchi].fixesValue())
+    {
+        eBCTypes[patchi] = zeroGradientFvPatchScalarField::typeName;
+    }
+}
+
+Info<< "Constructing energy field e\n" << endl;

 volScalarField e
 (
@@ -124,9 +138,10 @@ volScalarField e
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
-       IOobject::NO_WRITE
+       IOobject::AUTO_WRITE
    ),
-   p/(GAMMA - 1)/rho + magSqr(U)/2
+   p/(GAMMA - 1)/rho + magSqr(U)/2,
+   eBCTypes
 );

And then result will be something like: fvm::div(phi, e)-Closes#7

staneuski commented 5 years ago

Check commit dbd0428

Co~0,5

vl-zenkin commented 5 years ago

Я вот заметил: почему справа скорость замирает на нуле (как и положено), а слева - нет? P.S. Лучше б вместо магнитуды скорости строить ux.

staneuski commented 5 years ago

@vl-zenkin ezgif com-video-to-gif-3