CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

interpolation for pressure

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

Like Tree24Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   September 7, 2011, 08:27
Default
  #21
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Thank you Alberto, I also found it and now trying to understand this expression.
Please see attached file Volumefield_reconstruction.pdf. I am looking for the original reference where this formulation is established. Could you please give some tips?
ganeshv likes this.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   September 7, 2011, 21:16
Default
  #22
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
I do not have a reference for this, but I think you got it.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   September 8, 2011, 03:37
Default
  #23
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Alexander, I think it would be nice to have this on the wiki. If you agree, do you have the time to copy it to an article there?
akidess is offline   Reply With Quote

Old   September 8, 2011, 03:39
Default
  #24
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 213
Rep Power: 10
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Hi Anton!

Ok, I will put it there. And if Alberto doesn't mind, it would look better with his description of the body forces and the pressure gradient treatment technique.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Advanced Process Simulation of
Solidification and Melting"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

Franz-Josef-Str. 18
A - 8700 Leoben
Österreich / Austria
Tel.: +43 3842 - 402 - 3125
http://smmp.unileoben.ac.at

Last edited by makaveli_lcf; September 8, 2011 at 03:43. Reason: Additions
makaveli_lcf is offline   Reply With Quote

Old   September 13, 2011, 01:20
Default
  #25
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Alexander,

Quote:
Originally Posted by makaveli_lcf View Post
Thank you Alberto, I also found it and now trying to understand this expression.
Please see attached file Attachment 9124. I am looking for the original reference where this formulation is established. Could you please give some tips?
we were chatting about fvc::reconstruct() with Alberto few months ago and I took similar notes of the method, writing out the algorithm in mathematical form. I was looking for a "continuum form" of this operator, I think it's based in a generalized form of Gauss Theorem [like (3.9) to (3.16) in Hrv. thesis] due to a surface defined field is transformed in cell defined one, but I couldn't hack it, maybe these ideas could help you to find the basis.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   July 26, 2012, 04:28
Default Could you be so kind to write down the corresponding code for the equation for p?
  #26
New Member
 
Join Date: Nov 2010
Posts: 2
Rep Power: 0
vgalindo is on a distinguished road
Dear Alberto,

thank you very much for this very detailed explanation about the issue how to add correctly a body force to the (incompressible) momentum equation!
I would be grateful if you would still specify the corresponding code for the p equation.

Best regards, Vladimir


Quote:
Originally Posted by alberto View Post
I will try to give you the basic idea in the case of a generic body force term F, so that your momentum equation reads:

(1) ddt(U) + div(UU) = div(tau) - grad(p)/rho + F

This equation can be written in semi-discrete form as:

(2) A*U = H - grad(p)/rho + F

where the pressure gradient and the force term we want to include in the momentum interpolation is left explicitly out at this point. In other words, only the first three terms (time derivative, unsteady, divergence of the stress tensor) of Eq. 1 are used to define A and H. For example, in an incompressible code, this could read (it might be different, depending on the solver):

Code:
     fvm::ddt(U)
  + fvm::div(phi, U)
  + turbulence->divDevReff(U)
Normally the pressure gradient would be treated directly as a source term in an incompressible code (see pisoFoam for example). Here we assume we want to treat it with the "improved approach".

From Eq. 2, interpolating on faces and dotting with the surface area vector S the pressure gradient and the force term, we have:

- snGrad(p)*|S|/rho + F_f . S

where F_f is F interpolated on faces. This in OF corresponds to:

Code:
- fvc::snGrad(p)*mesh.magSf()/rhoa + fvc::interpolate(F) & mesh.Sf()
This term can be used as argument of fvc::reconstruct() to add the contribution of the pressure gradient and of the force term to the momentum predictor:

Code:
solve
(
      UEqn == fvc::reconstruct
      (
          - fvc::snGrad(p)*mesh.magSf()/rhoa 
          + fvc::interpolate(F) & mesh.Sf()
   )
)
Then OpenFOAM re-computes U as

U = H/A

where A is updated with the predicted value of U. However, keep in mind that H does not directly include the effect of grad(p) and F.

From Eq. 2 we can derive the flux to construct the pressure equation:

phi = (H/A)_f . S - (1/A)_f * snGrad(p) |S|/rho + (1/A)_f*F_f . S

and imposing div(phi) = 0, you obtain the pressure equation, which will include for the first time all the effects.

The flux is then corrected based on the solution of the pressure equation, and the velocity correction is reconstructed from the flux. Only at this point U will "see" the effect of p and F.

If you take a look at VOF solvers (i.e. interFoam), you will notice that the code does not solve for p, but for p_rgh = p + rho*gh. This is another way to treat the gravity to address the weakness of the Rhie-Chow interpolation, but the idea is similar.

I hope this helps, but please let us know if you have more questions

Best,
vgalindo is offline   Reply With Quote

Old   July 29, 2012, 15:20
Default
  #27
Member
 
Join Date: May 2012
Location: Dresden, Germany
Posts: 32
Rep Power: 5
dl6tud is on a distinguished road
Hallo Vladimir,

I don't understand everything yet, but based on interFoam it should be sth like that:
Quote:
ScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf = fvc::interpolate(rUA);

U = rUA * UEqn.H();

surfaceScalarField phi = fvc::interpolate(U) & mesh.Sf();
surfaceScalarField Ff = fvc::interpolate(F) & mesh.Sf();

[...]

fvScalarMatrix pEqn
(
fvm::div(rUAf*fvm::snGrad(p)*mesh.magSf()/rho) == fvc::div(phi)
+ fvc::div(rUAf*Ff);
);


[...]

U += rUA*fvc::reconstruct(Ff/rUAf);
I am not sure how to transform div.(snGrad), but probably we have to use:

Quote:
fvScalarMatrix pEqn
(
fvm::laplacian(rUAf,p*mesh.magSf()/rho
) == fvc::div(phi) + fvc::div(rUAf*Ff) ;
);
In interFoam the velocity is corrected only for the force. But they put phi and Ff together (and name it phi) -> I am not sure why.
Working on pisoFoam, I think rho has to be removed. I do not know if phi has to contain only the velocity flux, or the 'force flux', too. Any idea?

For my understanding: Can someone give me a hint, what 'reconstruct' does? It 'adds' terms to the equation and changes A and H? But there must be a difference between

Quote:
solve ( UEqn == fvc::reconstruct ( - fvc::snGrad(p)*mesh.magSf()/rhoa + fvc::interpolate(F) & mesh.Sf() ) )
and
Quote:
solve ( UEqn == - fvc::snGrad(p)*mesh.magSf()/rhoa + fvc::interpolate(F) & mesh.Sf() )
dl6tud is offline   Reply With Quote

Old   July 30, 2012, 01:33
Default plz help me
  #28
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 4
vahid.najafi is an unknown quantity at this point
Hi Dear alberto again:
I want to add surface tension(sigma) in one solver,for this reason I added :
#include ''fvCFD.H''
fvc::interpolate(interface.sigma())

in this code:
Foam::tmp<Foam::volScalarField>
Foam:haseChangeTwoPhaseMixtures::SchnerrSauer: Coeff
(
const volScalarField& p
) const
{
volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));
volScalarField rho
(
limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()
);
return

//......I want to change it( <<sigma>> surface tension multiple in it):
(3*rho1()*rho2())*sqrt(2/(3*rho1()))*(fvc::interpolate(interface.sigma()))
*rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat()));
//.................................................. ......
}
dont successful wmake, and seen(was not declared ):
phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C:113: error: 'interface' was not declared in this scope
make: *** [Make/linux64GccDPOpt/SchnerrSauer.o] Error 1
please help me,and tell me ,How to correct this problem???

vahid.najafi is offline   Reply With Quote

Old   June 4, 2014, 10:51
Default
  #29
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 112
Rep Power: 8
be_inspired is on a distinguished road
HI all,

How could it be done in case it is not a body force but a vectorField?

All is in relation to the rotorDiskSource and how introducing this source in the momentum equation can create wiggles in the pressure field and velocity field.

Thank you

Last edited by be_inspired; June 6, 2014 at 07:14.
be_inspired is offline   Reply With Quote

Old   February 23, 2015, 10:16
Default
  #30
New Member
 
Peter
Join Date: May 2012
Location: New York
Posts: 18
Rep Power: 5
chinaduck is on a distinguished road
Quote:
Originally Posted by harry View Post
Does Openfoam implement body-force-weighted scheme for pressure interpolation?

Hello Harry,
Did you finally solve your problem? I have met a similar problem regarding the body-force-weighted scheme for pressure interpolation.
Do you have any ideas on this? Thanks a lot for your help and time!

Best,

Peter
chinaduck is offline   Reply With Quote

Reply

Tags
body force, force

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
urgent help needed (rhie-chow interpolation problem) Ardalan Main CFD Forum 2 March 18, 2011 16:22
Help on 2D interpolation in StarCCM+ madhuri CD-adapco 0 November 3, 2010 15:21
Surface interpolation schemes and parallelization jutta OpenFOAM Running, Solving & CFD 0 February 25, 2010 15:32
momentum interpolation for collocated grid Hadian Main CFD Forum 4 December 25, 2009 08:25
spline interpolation bajjal Main CFD Forum 0 May 29, 2006 08:27


All times are GMT -4. The time now is 22:27.