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

gradient of pressure

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Bernhard

Reply
 
LinkBack Thread Tools Display Modes
Old   September 4, 2013, 04:37
Default gradient of pressure
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 742
Rep Power: 8
sharonyue is on a distinguished road
Hi All,

In VOF, we have this equation:

{p_d} = p - \rho g \cdot h

In the code, it reads:

\nabla {p_d} = \nabla p - \rho g - g \cdot h\nabla \rho

Well,Shouldn't it be

\nabla {p_d} = \nabla p - g \cdot h\nabla \rho  - \rho \nabla(g \cdot h)?
Attached Images
File Type: jpg 1.jpg (20.3 KB, 13 views)

Last edited by sharonyue; September 4, 2013 at 09:21.
sharonyue is offline   Reply With Quote

Old   September 8, 2013, 21:22
Default
  #2
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 742
Rep Power: 8
sharonyue is on a distinguished road
hello? no one is here
sharonyue is offline   Reply With Quote

Old   September 11, 2013, 10:09
Default
  #3
New Member
 
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 5
Sylv is on a distinguished road
And in the source code, how it looks? Do you have a piece of code?
Sylv is offline   Reply With Quote

Old   September 11, 2013, 19:58
Default
  #4
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 742
Rep Power: 8
sharonyue is on a distinguished road
Quote:
Originally Posted by Sylv View Post
And in the source code, how it looks? Do you have a piece of code?
In interFoam's UEqn's code:

Code:
fvVectorMatrix UEqn
    (
        fvm::ddt(rho, U)
      + fvm::div(rhoPhi, U)
      + turbulence->divDevRhoReff(rho, U)
    );

    UEqn.relax();

    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
                (
                    fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                ) * mesh.magSf()
            )
        );
    }
Its:
\nabla {p_d} = \nabla p - \rho g - g \cdot h\nabla \rho

but why?
sharonyue is offline   Reply With Quote

Old   September 16, 2013, 04:32
Default
  #5
New Member
 
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 5
Sylv is on a distinguished road
mmmh, I'm not familiar with interFoam, so I don't know the hypothesis involved in the design of this solver, and by extend, in the selection of the equations.

Regarding your first post, I agree with you, the following equation seems the right one: \nabla {p_d} = \nabla p - g \cdot h\nabla \rho  - \rho \nabla(g \cdot h). BUT, as I said, it might have a dozen of hypothesis which explain the selection of the first equation.

What about validation and/or papers on interFoam? If the equations were really wrong, somebody should have noticed it. Look at this page, it might help you: http://openfoamwiki.net/index.php/InterFoam
Sylv is offline   Reply With Quote

Old   September 16, 2013, 04:39
Default
  #6
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 13
Bernhard is on a distinguished road
\nabla(g\cdot h)=g
There is no difference between the two, nor any underlying assumption, because

\nabla( g\cdot h)=\nabla (g_x x + g_y y + g_z z) =(g_x, g_y, g_z),
only assuming that g is a constant.
sharonyue likes this.
Bernhard is offline   Reply With Quote

Old   September 16, 2013, 04:43
Default
  #7
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 742
Rep Power: 8
sharonyue is on a distinguished road
Quote:
Originally Posted by Sylv View Post
mmmh, I'm not familiar with interFoam, so I don't know the hypothesis involved in the design of this solver, and by extend, in the selection of the equations.

Regarding your first post, I agree with you, the following equation seems the right one: \nabla {p_d} = \nabla p - g \cdot h\nabla \rho  - \rho \nabla(g \cdot h). BUT, as I said, it might have a dozen of hypothesis which explain the selection of the first equation.

What about validation and/or papers on interFoam? If the equations were really wrong, somebody should have noticed it. Look at this page, it might help you: http://openfoamwiki.net/index.php/InterFoam
Thank you man, I think Bernhard is rite, its only math...
Thank you both.
sharonyue is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressure Outlet Guage pressure Mohsin FLUENT 36 April 29, 2016 17:16
how to get pressure and pressure gradient using UDF Honglin Fluent UDF and Scheme Programming 0 May 24, 2012 06:47
lid-driven cavity in matlab using BiCGStab Don456 Main CFD Forum 1 January 19, 2012 16:00
Pressure BC for combustion chamber Giuki FLUENT 1 July 19, 2011 11:35
Inputting pressure gradient in Fluent Josyula FLUENT 2 December 23, 2009 08:26


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