CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Creating solver without pressure corrections (https://www.cfd-online.com/Forums/openfoam-programming-development/160094-creating-solver-without-pressure-corrections.html)

Lisandro Maders October 1, 2015 16:38

Creating solver without pressure corrections
 
Hi,

I am trying to create a solver that solves only the following equations:

1) Continuity
2) Momentum
3) Generic transport equation of variable Z

The fact is that my pressure field is constant, it almost does not vary. And also I take the density from a table based on Z values. So I do not need to make that pressure corrections that SIMPLE algorithm and others do. So how to proper write the .C solver file? Or if you can suggest me to take a look in some specific code that has this simplification it would be good as well.

Regards,

Lisandro

Lisandro Maders October 1, 2015 20:15

What I have done so far..
 
Here is what I have done so far, but it is dividing by zero (at least I interpreted the error like this) somewhere in rhoEqn..

Code:

int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"
    #include "initFGM.H"
    #include "createFields.H"

    simpleControl simple(mesh);

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    #include "CourantNo.H"
//    #include "compressibleCourantNo.H"

    while (simple.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        while (simple.correctNonOrthogonal())
        {
        Info << " Antes de rhoEqn.H " << endl;
        Info << " Escrevendo rho " << rho << endl;
        Info << " Escrevendo phi " << phi << endl;
        #include "rhoEqn.H"
        #include "UEqn.H"
        #include "pvEqn.H"
        #include "ztEqn.H"
        }

        if (runTime.write())
        {
            #include "writeFGMfields.H"
            #include "writeThermoPropertyFields.H"
        }

        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
    }

    Info<< "End\n" << endl;

    return 0;
}

Anything incredibly wrong at a first look?

Lisandro Maders October 7, 2015 09:31

Still weird
 
Jamamoto,

I interpreted your "like" as: that looks right! However, the results I am getting for velocity field are very weird, which tells me I missed something in this simplification.

Could you or someone else give me some help on this? Is there any solver in OpenFOAM that does not make use of such simplification (no pressure/momentum corrections)..


Thanks!


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