CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

rhoCentralFoam cannot run with moderate Co numbers

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 12, 2021, 04:06
Default rhoCentralFoam cannot run with moderate Co numbers
  #1
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Hello everyone,

I am doing verification work with plat plate which is meshed with hexa meshs. 0.3Ma and 100k Re number is flow conditions. Here is the checkMesh output:
Code:
Create time

Create mesh for time = 0

Time = 0

Mesh stats
    points:           108559
    faces:            301540
    internal faces:   278060
    cells:            96600
    faces per cell:   6
    boundary patches: 7
    point zones:      0
    face zones:       1
    cell zones:       1

Overall number of cells of each type:
    hexahedra:     96600
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology
    bc-2                920      1023     ok (non-closed singly connected)
    bc-6                1380     1529     ok (non-closed singly connected)
    bc-8                700      781      ok (non-closed singly connected)
    bc-3                460      517      ok (non-closed singly connected)
    bc-4                9660     9869     ok (non-closed singly connected)
    bc-5                9660     9869     ok (non-closed singly connected)
    bc-7                700      781      ok (non-closed singly connected)

Checking faceZone topology for multiply connected surfaces...
    FaceZone            Faces    Points   Surface topology
    interior-unspecified278060   108551   multiply connected (shared edge)
  <<Writing 107691 conflicting points to set nonManifoldPoints

Checking basic cellZone addressing...
    CellZone            Cells        Points       Volume       BoundingBox
    unspecified         96600        108559       0.375        (-1 0 0) (2 0.25 0.5)

Checking geometry...
    Overall domain bounding box (-1 0 0) (2 0.25 0.5)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (7.58991e-17 -7.5588e-16 2.59421e-16) OK.
 ***High aspect ratio cells found, Max aspect ratio: 8333.33, number of cells 18850
  <<Writing 18850 cells with high aspect ratio to set highAspectRatioCells
    Minimum face area = 5e-09. Maximum face area = 0.00529875.  Face area magnitudes OK.
    Min volume = 1.25e-10. Max volume = 0.000132469.  Total volume = 0.375.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 2.13164e-14 OK.
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End
As you see, high aspect ratio cells failed. Even though, i do analysis with laminar flow, boundary layer is refined well for future works. In my opinion, this should not be problem though.

Bc-6 and bc-8 are pressure outlet, and bc-7 is velocity inlet. Bc-2 is plate wall and the rests are symmetry bcs. Here are case settings :
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2006                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (104.1634 0 0);

boundaryField
{
    bc-6
    {
        type            zeroGradient;
    }

    bc-8
    {
        type            zeroGradient;
    }

    bc-7
    {
	 type            fixedValue;
        value           $internalField;
    }

    bc-3
    {
        type            symmetryPlane;
    }

    bc-4
    {
        type            symmetryPlane;
    }

    bc-5
    {
        type            symmetryPlane;
    }

    bc-2
    {
        type            noSlip;
    }

}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2006                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{
    bc-6
    {
	type            zeroGradient;
    }

    bc-8
    {
	 type            zeroGradient;
    }

    bc-7
    {
	 type            fixedValue;
        value           $internalField;
    }

    bc-3
    {
        type            symmetryPlane;
    }

    bc-4
    {
        type            symmetryPlane;
    }

    bc-5
    {
        type            symmetryPlane;
    }

    bc-2
    {
        type            zeroGradient;
    }
   
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2006                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 1479.288;

boundaryField
{
    bc-6
    {
        type            totalPressure;
        p0           $internalField;
    }

    bc-8
    {
        type            totalPressure;
        p0           $internalField;
    }

    bc-7
    {
        type            zeroGradient;
    }

    bc-3
    {
        type            symmetryPlane;
    }

    bc-4
    {
        type            symmetryPlane;
    }

    bc-5
    {
        type            symmetryPlane;
    }

    bc-2
    {
        type            zeroGradient;
    }

}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

fluxScheme      Kurganov;

ddtSchemes
{
    default       CrankNicolson 0.8;	//Euler;	
    //ddt(phi)	  CrankNicolson 1.0;	
}

gradSchemes
{
    default        cellLimited Gauss linear 1.0;
}

divSchemes
{
    default         none;
    div(tauMC)      Gauss linear;	///Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected ;
}

interpolationSchemes
{
    default         linear;
    reconstruct(rho) vanLeer;
    reconstruct(U)  vanLeerV;
    reconstruct(T)  vanLeer;
}

snGradSchemes
{
    default         corrected;
}

/*wallDist
{
    method meshWave;
}*/



// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "(rho|rhoU|rhoE)"
    {
        solver          diagonal;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps         2;
        tolerance       1e-12;
        relTol          0.1;
    }

    h
    {
        $U;
        tolerance       1e-12;
        relTol          0.01;
   }

     "(U|h)Final"
    {
        $U;
        relTol          0;
    }  
 
    e
    {
        solver          GAMG;
        smoother        GaussSeidel;
        tolerance       1e-12;
        relTol          0.1;
    }  
     eFinal
    {
        $e;
        relTol          0;
    }
}

cache
{
    grad(U);
}
// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     rhoCentralFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         0.05;

deltaT          1e-03;

writeControl    adjustableRunTime;

writeInterval   0.001;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           0.5;

maxDeltaT       0.01;
When i choose max courant number as 0.1 , the case keep running and end up with good results. However, when i increase to at most 0.2, it is blow up. While Ansys Fluent let to 4-5 Co number, why i cannot chose higher courant in Openfoam. Low co means higher calculation times. This is what it gives when i choose Co : 1 .0, deltaT is so small :
Code:
Mean and max Courant Numbers = 0.00122766 0.713041
deltaT = 3.34673e-08
Time = 1.70413e-06

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 0.000246952, Final residual = 6.03144e-06, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.0022567, Final residual = 6.19651e-05, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.000715669, Final residual = 1.91404e-05, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG:  Solving for e, Initial residual = 0.00237767, Final residual = 5.07603e-05, No Iterations 1


--> FOAM FATAL ERROR:
Negative initial temperature T0: -1501.71

    From Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
    in file /opt/apps/OpenFOAM/OpenFOAM-v2006/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 56.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::exitOrAbort(int, bool) at ??:?
#2  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, bool) at ??:?
#3  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:?
#4  ? at ??:?
#5  __libc_start_main in /usr/lib64/libc.so.6
#6  ? at ??:?
Case is simple, mesh is good. There should be mistakes on Bcs or Schemes . Otherwise, rhoCentralFoam is not well solver as it sad. Are there any adviced to increase Co number ?

Thanks for any advice.
hbulus is offline   Reply With Quote

Old   March 18, 2021, 02:44
Default
  #2
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Really? No one has any idea ?
hbulus is offline   Reply With Quote

Old   March 23, 2021, 05:41
Default
  #3
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
The reason why Ansys works is probably, that it goes back to first order schemes when it notices divergence. You dont have that in OpenFoam.


You are trying second order schemes with high courant numbers. That usually doesnt work well, because naturally high order schemes impose oscillations in your simulaitons. Thats why those limiters like vanLeer were invented. If you want high Co-Numbers you should use Minmod instead of vanLeer. But Minmod is not truly second order.


If you still want vanLeer you can use the limitTemperature functionality. Your BCs might be also wrong, -1500K is quite a heavy result. Also your mesh is not good.
shock77 is offline   Reply With Quote

Old   March 24, 2021, 03:54
Default
  #4
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Quote:
Originally Posted by shock77 View Post
The reason why Ansys works is probably, that it goes back to first order schemes when it notices divergence. You dont have that in OpenFoam.


You are trying second order schemes with high courant numbers. That usually doesnt work well, because naturally high order schemes impose oscillations in your simulaitons. Thats why those limiters like vanLeer were invented. If you want high Co-Numbers you should use Minmod instead of vanLeer. But Minmod is not truly second order.


If you still want vanLeer you can use the limitTemperature functionality. Your BCs might be also wrong, -1500K is quite a heavy result. Also your mesh is not good.
Thanks for your reply. I am limiting T in fvOptions between 101 and 1000 K. However, it reaches output of this value, -1500k. I dont get it why T limiter does not work.
Why does the mesh is not good? Can you explain more? It is fully up Hexas, with very fine BL. It is normal to have high aspect ratio, dont you agree ?

I tried minmod,vanLeer,upwing, nothing has changed
hbulus is offline   Reply With Quote

Old   March 24, 2021, 05:27
Default
  #5
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
As soon as you start your simulation, in the first few lines of the log, there should a message appear that states that fvOption with the limiter functionality has been chosen. If there is no such message or an error occured, you dont use this functionality.


As I said, rhoCentralFoam hasnt this functionality, if you didnt have implemented it yourself, its not working.
shock77 is offline   Reply With Quote

Old   March 24, 2021, 07:58
Default
  #6
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Quote:
Originally Posted by shock77 View Post
As soon as you start your simulation, in the first few lines of the log, there should a message appear that states that fvOption with the limiter functionality has been chosen. If there is no such message or an error occured, you dont use this functionality.


As I said, rhoCentralFoam hasnt this functionality, if you didnt have implemented it yourself, its not working.
Yeap i found your code, then implemented. Thanks for that. In the log file, it says "Selecting finite volume options type limitTemperature". Therefore, i assume fvOptions is activated.
Although i can choose higher Co numbers now, when it is crashed, it gives Negative initial temp T0: -497 again. Because it starts to exceed max Co limit now. Normally it should not exceed max Co limit, because time step is adjusted.

DO you have any idea why it gives this error?
hbulus is offline   Reply With Quote

Old   March 24, 2021, 08:21
Default
  #7
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
Besides wrong BCs, what you should definitly check, my best practice suggestions would be:


1. vanAlbada instead of vanLeer limit, which is less oscillary
2. Co = 0.2 or better 0.1 if possible
3. check your thermophysical properties, especially their units
4. first run laminar, then add a turbulence model
5. dont use GAMG, I have bad experiences with that. Also use relTol 0.


This is the fvSchemes dict from one of my cases:


Code:
solvers
{
    "rho.*"
    {
        solver          diagonal;
    }

    "U.*"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps         2;
        tolerance       1e-9;
        relTol          0.0;
    }

    e
    {
        $U;
        tolerance       1e-9;
        relTol          0.00;
    }
    h
    {
        $U;
        tolerance       1e-9;
        relTol          0.00;
    }
    
    "(k|omega|epsilon|f|v2)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-09;
        nSweeps         2;
        relTol          0.0;
    }
}
shock77 is offline   Reply With Quote

Old   March 25, 2021, 02:02
Default
  #8
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Thanks for your helps. I tried most of your suggestions. However, it seems no possibility for increase without changing BCs.

I am doing verification case of a laminar flat plate which is exposed to 0.3-10k Re and 0.87-100kRe Mach flows. I am comparing dimensionless Rho and dimensionless T in boundary layer with analytical results. The BL thichness with rhoCentralFoam is larger than it supposed to be. I tried to increase CFL number first by thinking case is not converged. However, i run it for long time, and results are not changed. So, i am sure that it converged.
There is 2 possibility: BCs or Unconformity of solver. I should add, i am also making analysis with rhoPimpleFoam. This solver predicts velocity profile correct but T and Rho dont have correct profiles. On the contrary, RhocentralFoam predicts T and Rho but velocity profile is not correct. Something about Bc must be wrong.

As it can be seen in my first post, named patchs as bc-2 wall, bc-3/bc-4/bc-5 sym, bc-6/bc-8 pressure outlet, bc-7 pressure inlet.

What would you suggest as boundary conditions for my case?
hbulus is offline   Reply With Quote

Old   March 25, 2021, 06:18
Default
  #9
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
I rechecked your BCs and might have found the error. For supersonic flow you usually use at the Inlet fixedValue for u,T and p. For the outlet I mostly use waveTransmissive for u and p and zeroGradient for T, but my cases have a lot of shocks and shock interactions. Still you should try that.


If you want to use totalPressure (depending what you know about your flow from measurements etc.), you should use totalPressure, totalTemperature, pressureInletOutletVelocity at the inlet and waveTransmissive and zeroGradient at the outlet.


Hope it helps.
shock77 is offline   Reply With Quote

Old   March 25, 2021, 07:38
Default
  #10
Member
 
Join Date: Dec 2018
Posts: 75
Rep Power: 7
hbulus is on a distinguished road
Quote:
Originally Posted by shock77 View Post
I rechecked your BCs and might have found the error. For supersonic flow you usually use at the Inlet fixedValue for u,T and p. For the outlet I mostly use waveTransmissive for u and p and zeroGradient for T, but my cases have a lot of shocks and shock interactions. Still you should try that.


If you want to use totalPressure (depending what you know about your flow from measurements etc.), you should use totalPressure, totalTemperature, pressureInletOutletVelocity at the inlet and waveTransmissive and zeroGradient at the outlet.


Hope it helps.
Can you share me a case of yours to see clearly BCs ?

In ansys fluent, you can define operating pressure or gauge pressure. For incompressible flows, P_g is zero assumed and P_ope is defined. For compressible is the opposite of that.

If i define P_ope as 104 Kpa in fluent, what should i define the pressure in Openfoam ?
hbulus is offline   Reply With Quote

Old   March 25, 2021, 10:16
Default
  #11
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
I cant help you with ansys since I dont work with that.


You can find all BCs just by googling it and by looking into the documentation of openfoam.


e.g.


Code:
waveTransmissive


        type            waveTransmissive;
        gamma           1.4;
        fieldInf        101325;
        lInf            1;
        value           uniform 101325;


or totalPressure


        type            totalPressure;
        rho             none;
        psi             thermo:psi;
        gamma           1.4;
        p0              uniform 2e5;
        value           uniform 2e5;
shock77 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in foam-extend 4.0 ggi parallel run Metikurke OpenFOAM Running, Solving & CFD 0 February 20, 2018 07:34
parallel run is slower than serial run (pimpleFoam) !!! mechy OpenFOAM 18 August 17, 2016 18:19
Slow run with rhoCentralFoam yash.aesi OpenFOAM Running, Solving & CFD 20 June 15, 2015 08:16
Can not run OpenFOAM in parallel in clusters, help! ripperjack OpenFOAM Running, Solving & CFD 5 May 6, 2014 16:25
HELP!! Prandtl numbers in RNG k-e turbulence model maoasis FLUENT 0 April 24, 2006 11:51


All times are GMT -4. The time now is 01:29.