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

Implement simple barotropic relation - derive density field from pressure field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2015, 04:49
Exclamation Implement simple barotropic relation - derive density field from pressure field
  #1
New Member
 
Gert-Jan Meijn
Join Date: Apr 2015
Posts: 8
Rep Power: 11
GJM1991 is on a distinguished road
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!
GJM1991 is offline   Reply With Quote

Old   March 4, 2016, 11:06
Default
  #2
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
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

Last edited by wyldckat; March 13, 2016 at 17:18. Reason: merged similar posts
sandy is offline   Reply With Quote

Old   March 8, 2016, 22:16
Default
  #3
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
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!

Last edited by wyldckat; March 13, 2016 at 17:19. Reason: Added [CODE][/CODE] markers
sandy is offline   Reply With Quote

Old   March 13, 2016, 17:26
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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."
__________________

Last edited by wyldckat; March 13, 2016 at 17:27. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   March 29, 2016, 10:20
Default how to write pEqn.C
  #5
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
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 is offline   Reply With Quote

Old   May 3, 2016, 06:28
Default Could not get correct results
  #6
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
Hi Bruno,

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

Sandy
sandy is offline   Reply With Quote

Old   May 8, 2016, 16:43
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 View Post
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
wyldckat is offline   Reply With Quote

Reply

Tags
barotropic, cavitation, compressible fluids


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Pressure enigma. Sara Main CFD Forum 22 July 30, 2009 05:46
Does star cd takes reference pressure? monica Siemens 1 April 19, 2007 12:26
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 03:15
Using SIMPLE david Main CFD Forum 5 July 21, 1999 03:38


All times are GMT -4. The time now is 00:23.