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/)
-   -   Implement simple barotropic relation - derive density field from pressure field (https://www.cfd-online.com/Forums/openfoam-programming-development/153488-implement-simple-barotropic-relation-derive-density-field-pressure-field.html)

GJM1991 May 27, 2015 03:49

Implement simple barotropic relation - derive density field from pressure field
 
Dear all,

For my thesis I want to research cavitation by using barotropic relations (like Delannoy & Kueny in 1990).
This has the advantage that I don't necessarily need a complex multiphase solver, but can use a simple compressible solver combined with a barotropic relation to solve the problem. To be more specfic, I want to use a hyperbolic tangent to model the transition from liquid density to vapor density and this function is completely depending on the pressure.

I am looking for a quick and dirty way to implement this barotropic equation into a compressible solver.
Meaning that I would like to update my density simply by relating it to a curve that gives density as a function of pressure, if you know the pressure field, the density should follow directly.
To my understanding most OpenFOAM-solvers get the density field by evaluating the pressure-field, and after this, perform a density update by calling 'thermo.rho()'.
Thus far I've been looking at compressible solvers like rhoCentralFoam or rhoSimpleFoam but they all go back to the thermophysical part and perform some kind of method like 'thermo.correct()' to update the density and other properties.
I find the thermophysical part of OpenFOAM extremely difficult to comprehend, so I am wondering if there is an easier way to relate the density to the pressure-field, a simple function that takes the pressure-field and directly manipulates it into the density-field without intervention of the thermophysical modules, can anything go wrong with that?
Or am I stuck with the thermophysical module and need to insert a new 'equation of state' into the existing files, but where do I start with that?

Can anybody help me or send me an example to look at? You would make my day!

sandy March 4, 2016 10:06

I also have the same question. Why there is no a cavitation model by using barotropic relations (like Delannoy & Kueny in 1998) in OF? I also want to inplement Delannoy's relations into interPhaseChangeFoam solver instead of alpha equation, however, I am failed. Who can help?

----------

Dear all,

In the interPhaseChangeFoam solver, there are some cavitation models by using tranport equation, such as kunz's model, merkly's model. However, I want to implement a cavitation model by using barotropic relations, namley Delannon & Kueny's model (1998), into interPhaseChangeFoam solver instead of alpha equation, but I could not get the correct results. I would like to know, who also try it? Please help.

Sandy

sandy March 8, 2016 21:16

Code:

while (pimple.correctNonOrthogonal())
    {
        fvScalarMatrix p_rghEqn
        (
            fvm::ddt(psi, p_rgh)
        +  fvc::div(phiHbyA)
          -  fvm::laplacian(rhorAUf, p_rgh)     
 
       
        );

        p_rghEqn.setReference(pRefCell, pRefValue);

        p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));

        p_rgh.correctBoundaryConditions();
       

        if (pimple.finalNonOrthogonalIter())
        {
            phi = (phiHbyA + p_rghEqn.flux())/rhof;

            p_rgh.relax();

            U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
            U.correctBoundaryConditions();
            fvOptions.correct(U);
        }
    }

I use this p_rgh equation, but I don't know why I could not get divergent results. Who can help me to find the problem? Thank you very much!

wyldckat March 13, 2016 16:26

Quick question: Doesn't cavitatingFoam do what you're asking for, namely to use barotropic compressibility?
There is a thread on this topic here: http://www.cfd-online.com/Forums/ope...equations.html

Also see the OpenFOAM User Guide, section "3.7 Standard libraries".

edit: And search in this page: http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2014/ - for this: "Baris Bicer: Implementation of Transport Model into CavitatingFoam to simulate the Cavitation in Diesel Injector Nozzle."

sandy March 29, 2016 09:20

how to write pEqn.C
 
Hi Bruno,

Thanks for the reply. However, I think there are many differences in the barotropic equation between cavitatingFoam and Delannoy & Kueny's . I don't know how to write a pEqn.C for Delannoy & Kueny's model as like as it in cavitatingFoam. Could you help me?

Sandy

sandy May 3, 2016 05:28

Could not get correct results
 
Hi Bruno,

I did many tries, but I still could not get convergent results. Do you know the reasons. Please help.

Sandy

wyldckat May 8, 2016 15:43

Hi Sandy,

Sorry, but unfortunately this is beyond my level of expertises and currently for these next few months I'm busy beyond my capabilities :(

Nonetheless:
Quote:

Originally Posted by sandy (Post 598294)
I did many tries, but I still could not get convergent results. Do you know the reasons.

You're being too vague in your description. Please follow the instructions given here: http://www.cfd-online.com/Forums/ope...-get-help.html

In the meantime, good luck and I hope anyone else can step in!


In case you don't get an answer here on the forum, you might want to try and hire someone to assist you, either:
  1. Ask for assistance on this forum: http://www.cfd-online.com/Forums/cfd-freelancers/
  2. Or contact one or more of the companies listed here: https://openfoamwiki.net/index.php/T...rontpage_Links
Best regards,
Bruno


All times are GMT -4. The time now is 06:04.