CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   rhoSimpleFoam not working (https://www.cfd-online.com/Forums/openfoam-solving/218092-rhosimplefoam-not-working.html)

cutmountain June 7, 2019 13:03

rhoSimpleFoam not working
 
Hello everybody,



I am working (trying to ) on an external aerodynamic case with a compressible flow and I need to use a steady state solver.


So I need to use rhoSimpleFoamm but the problem is that I am not able to let it run.



What I know is the velocity field at the inlet Ma=0.6 and the p_inf (static) which is 35000 Pa. So I imposed the correspondent velocity at the inlet and the value of p_inf at the outlet.



At first I had the problem that the sim was not able to start, but then I managed to limit the temperature between a maximum value and a minimum value and the sim started but after 50 iteration I had the temperature residual equal to 1 and then crashed.



I know that the problem is due to the BCs.



I add the BCs for U,T,p. Let me know if u need something else.


T

Code:

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 236;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform 236;
    }

    outlet
    {
        type            inletOutlet;
        value          uniform 236;
        inletValue      uniform 236;
    }

    "nose|body|wings|tail"
    {
        type            fixedValue;
        value          uniform 236;
    }   
    SphereW
    {
        type            cyclicAMI;
        value          $internalField;
    }
    SphereS
    {
        type            cyclicAMI;
        value          $internalField;
    }

}


U


Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    inlet
   
    {
    type        fixedValue;
    value        uniform (0 185 0);
    }
                   
   

    outlet
    {
        type            zeroGradient;
    }

    "nose|body|wings|tail"
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    SphereW
    {
        type            cyclicAMI;
        value          $internalField;
    }
    SphereS
    {
        type            cyclicAMI;
        value          $internalField;
    }

}




p


Code:

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

internalField  uniform 35687;

boundaryField
{
    inlet
    {
        type            zeroGradient;

    }
    outlet
    {
        type        fixedValue;                   
        value          uniform  35687;
    }
    "nose|body|wings|tail"
    {
        type            zeroGradient;
    }
    SphereW
    {
        type            cyclicAMI;
        value          $internalField;
    }
    SphereS
    {
        type            cyclicAMI;
        value          $internalField;
    }


Cheers,


CutMountain.

Swagga5aur June 7, 2019 16:22

Hello cutmountain, would it be possilbe to upload the case for potential debugging? It could be an issue with fv solution oe schwme, I had a similar problem recently, being due to no residual control of h as e was specified inatead.
Regards Lasse

cutmountain June 8, 2019 06:56

Dear Swagga,



thanks for caring.



here there are my fvSolution, fvSchemes and fvOptions.



I hope that my problem is the same as yours. You think that the boundary conditions are well posed?






fvSolution

Code:

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-08;
        relTol          0.1;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
    }

    "(U|e|k|omega)"
    {
        solver          GAMG;
        tolerance      1e-08;
        relTol          0.1;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 10;
    rhoMin          0.1;
    rhoMax          10.0;
    transonic      no;
    consistent      yes;


}

relaxationFactors
{
    fields
    {
        p              0.4;
        rho            0.01;
    T        0.01;
    }
    equations
    {
        p              0.4;
        U              0.6;
        e              0.4;
        k              0.6;
        omega          0.6;
    }
}


fvSchemes


Code:


 ddtSchemes
{
    default        steadyState;
}

gradSchemes
{
    default        cellLimited Gauss linear 0.333;
}

divSchemes
{
    default        none;

    div(phi,U)                        bounded Gauss upwind;
    div(phi,k)                      bounded Gauss upwind;
    div(phi,omega)                  bounded Gauss upwind;
    div(((rho*nuEff)*dev2(T(grad(U)))))    Gauss linear;
    div(phi,e)                  bounded Gauss upwind;
    div(phid,p)                bounded Gauss upwind;
    div(phi,Ekp)                bounded Gauss upwind;
    div((phi|interpolate(rho)),p)      bounded Gauss upwind;


}

laplacianSchemes
{
    default        Gauss linear uncorrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        limited 0.333;
}

wallDist
{
method meshWave;
}


fluxRequired
{
    default        no;
    p              ;
}


fvOptions


Code:

limitT
{
    type        limitTemperature;
    active        true;

    limitTemperatureCoeffs
    {
        Tmin        30;
        Tmax            1000;
        selectionMode    all;
    }
}


Cheers,



CutMountain.

Swagga5aur June 8, 2019 07:08

How does your thermophysical property file look?
I havn't used cyclicAMI before, but could you give an illustration of the domain with the different patch names?

I would suggest simply changing all the patches that aren't inlet or outlet to a simple wall to determine if its the boundary conditions, however the conditions seems fine from an initial glance.

Just a side note is it correct that the temperature is 236Kelvin?

Regards Lasse

cutmountain June 8, 2019 07:41

This is the thermo


Code:


thermoType
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        nMoles      1;
        molWeight  28.9;
    }
    thermodynamics
    {
        Cp          1005;
        Hf          0;
    }
    transport
    {
        As          1.4792e-06;
        Ts          116;
    }
}




The domain is a body inside a "windtunnel" that has a shape close to a bullet so I have just an inlet (the lateral surface of the bullet) and the outlet. I used the AMI because I had done two mesh separately and then merged because later I will have the necessity to turn the geometry, so instead of remeshing everytime I just rotate one of the two mesh and then I will merge them.



But this work because I firt run some incompressible sim and they went very well and all of them converged.



Maybe this mesh done in that way is not good for the compressible solver? (I can try to have a unique mesh and see if it works in that way)



But the think that (from what I've learned, cause I always did incompressible sim) the pressure boundary conditions works differently between inc and compr solver so my concern is about the pressure BC. You think that it is ok?

Swagga5aur June 8, 2019 15:27

I don't see any issues with your pressure BC's, maybe check out the tutorial case in tutorials->compressible->rhoSimpleFoam->angledDuctExplicitFixedCoeff or aerofoilNACA0012 for some comparability to your case.

Note that the tutorials are based upon openFOAM v6 don't know if its different from other distributions.

You are welcome to share your case if able, I'm not certain what else to suggests.

You could try the following fvSolution code:
Code:

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-08;
        relTol          0.1;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
    }

    "(U|e|k|omega)"
    {
        solver          GAMG;
        tolerance      1e-08;
        relTol          0.1;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 10;
    pMinFactor          0.1;
    pMaxFactor          10.0;
    transonic      yes;
    consistent      yes;


}

relaxationFactors
{
    fields
    {
        p              1;
    }
    equations
    {
        p              1;
        U              0.9;
        e              0.8;
        k              0.9;
        omega      0.9;
    }
}


giovanni.medici June 14, 2019 08:52

Have you tried decreasing the number of SIMPLE -> nNonOrthogonalCorrector,?
As you are solving with a steady state solver, there is no requirement of convergence on each tilmestep, you will reach it through relaxation factor. If the reason of an high nNonOrthogonalCorrector is mesh quality, I would tackle that problem in the first place.
You may find some interesting infos here:
By the way rhoSimpleFoam is a quite picky solver, hence maybe an initialization of the flow field (in particular U), with potentialFoam may help.
Have you tried initializing the U domain with potentialFoam? and with an internal value different than 0 (in your case something like (0 185 0) )?

In order to cross check BC may I suggest you to take a look to the aerofoilNACA0012 tutorial?

mAlletto December 18, 2020 03:53

Maybe it's a bit late but there is a OneraM6 wing tutorial available which was run with rhoSimpleFoam:


https://wiki.openfoam.com/OneraM6_by_Michael_Alletto


All times are GMT -4. The time now is 09:15.