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

Difference between UEqn in sonicFoam & Theory

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

Like Tree5Likes
  • 1 Post By sasanghomi
  • 1 Post By vwibaut
  • 1 Post By sasanghomi
  • 2 Post By vwibaut

Reply
 
LinkBack Thread Tools Display Modes
Old   June 14, 2013, 18:13
Default Difference between UEqn in sonicFoam & Theory
  #1
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Iran - Tehran
Posts: 185
Rep Power: 4
sasanghomi is on a distinguished road
Hi Foamers ,

I found a difference between UEqn in sonicFoam and Ferziger's book (Computational Methods for fluid Dynamics ).
In the code for UEqn in sonicFoam we have :
Code:
fvVectorMatrix UEqn
(
    fvm::ddt(rho, U)
    + fvm::div(phi, U)
    + turbulence->divDevRhoReff(U)
);

solve(UEqn == -fvc::grad(p));
This code ensures below equation :

\frac{\partial \rho u_{i}}{\partial t} + \frac{\partial \rho u_{i}u_{j}}{\partial x_{j}} = -\frac{\partial p}{\partial x_{i}} + \frac{\partial }{\partial x_{j}} (\mu _{eff}(\frac{\partial u_{i}}{\partial x_{j}} + \frac{\partial u_{j}}{\partial x_{i}})) - \frac{2}{3}\mu _{eff}\frac{\partial }{\partial x_{j}} (\frac{\partial u_{k}}{\partial x_{k}}\delta _{ij})

But in the Ferziger's book (generally in theory) there is another equation :

\frac{\partial \rho u_{i}}{\partial t} + \frac{\partial \rho u_{i}u_{j}}{\partial x_{j}} = -\frac{\partial p}{\partial x_{i}} + \frac{\partial }{\partial x_{j}} (\mu _{eff}(\frac{\partial u_{i}}{\partial x_{j}} + \frac{\partial u_{j}}{\partial x_{i}})) - \frac{2}{3}\frac{\partial }{\partial x_{j}} (\rho k \delta _{ij})-\frac{2}{3}\frac{\partial }{\partial x_{j}}(\mu _{eff}\frac{\partial u_{k}}{\partial x_{k}}\delta _{ij})

The last term in two equations are different . Please guide me that what is the origin of this difference ? And please correct me if I am wrong.

I appreciate any help from you.
Thanks and best regards,
Sasan.
immortality likes this.

Last edited by sasanghomi; June 27, 2013 at 03:42.
sasanghomi is offline   Reply With Quote

Old   June 26, 2013, 09:20
Default
  #2
Member
 
Valentin Wibaut
Join Date: Oct 2012
Posts: 45
Rep Power: 4
vwibaut is on a distinguished road
Your ferziger's equation comes from incompressible theory, no? You haven't any term
dui/dxi
immortality likes this.
vwibaut is offline   Reply With Quote

Old   June 26, 2013, 11:25
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
I think so
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 27, 2013, 01:34
Default
  #4
Member
 
lfgmarc's Avatar
 
Luis Felipe Gutierrez Marcantoni
Join Date: Oct 2010
Location: Cordoba-Argentina
Posts: 46
Rep Power: 6
lfgmarc is on a distinguished road
Send a message via MSN to lfgmarc
Dear sasanghomi,

I found the same incongruence some time ago. I think that is a bug, but if you have some time you can review the
Code:
 divDevRhoReff
member function to try to figure out this problem. I try to do this, but my conclusion was that it is an error, because the term

\frac{2}{3}\bar{\rho}\widetilde{k}\mathcal{I}

is missing

Best regards.

Felipe G.
__________________
Felipe G
lfgmarc is offline   Reply With Quote

Old   June 27, 2013, 02:54
Default
  #5
Member
 
Valentin Wibaut
Join Date: Oct 2012
Posts: 45
Rep Power: 4
vwibaut is on a distinguished road
Quote:
Originally Posted by lfgmarc View Post
Dear sasanghomi,

I found the same incongruence some time ago. I think that is a bug, but if you have some time you can review the
Code:
 divDevRhoReff
member function to try to figure out this problem. I try to do this, but my conclusion was that it is an error, because the term

\frac{2}{3}\bar{\rho}\widetilde{k}\mathcal{I}

is missing

Best regards.

Felipe G.

The term with 2/3 rho k is present in the equation. It is taken into account in the pressure (in the equation p = ps + 2/3 rho k). The results you have, after simulations, give you a pressure wich contains the real pressure and turbulent kinetic energy.
vwibaut is offline   Reply With Quote

Old   June 27, 2013, 03:09
Default
  #6
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 198
Rep Power: 8
Chris Lucas is on a distinguished road
Hi,

have a closer look at the function:

divDevRhoReff
and you will find your "missing" term

Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   June 27, 2013, 03:48
Default
  #7
Member
 
lfgmarc's Avatar
 
Luis Felipe Gutierrez Marcantoni
Join Date: Oct 2010
Location: Cordoba-Argentina
Posts: 46
Rep Power: 6
lfgmarc is on a distinguished road
Send a message via MSN to lfgmarc
Hi to all,

Can you say me the OF version ? because at least in OF1.7.0 I can't find this term.

A question about UEqn sonicFoam

Maybe I looked in a wrong location in the code.

sonicFoam pressure equation.

Code:
rho = thermo.rho();

volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();

surfaceScalarField phid
(
    "phid",
    fvc::interpolate(psi)
   *(
        (fvc::interpolate(U) & mesh.Sf())
      + fvc::ddtPhiCorr(rUA, rho, U, phi)
    )
);

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
    fvScalarMatrix pEqn
    (
        fvm::ddt(psi, p)
      + fvm::div(phid, p)
      - fvm::laplacian(rho*rUA, p)
    );

    pEqn.solve();

    if (nonOrth == nNonOrthCorr)
    {
        phi = pEqn.flux();
    }
}

#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
divDevRhoReff kEpsilon :

Code:
 
tmp<fvVectorMatrix> kEpsilon::divDevRhoReff(volVectorField& U) const
{
    return
    (
      - fvm::laplacian(muEff(), U)
      - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
    );
}
Thanks in advance.


Best regards.
__________________
Felipe G
lfgmarc is offline   Reply With Quote

Old   June 27, 2013, 03:50
Default
  #8
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Iran - Tehran
Posts: 185
Rep Power: 4
sasanghomi is on a distinguished road
Hi Guys ,
I corrected the momentum equation in first post (Theory equation). But I think below term is missed.

\frac{2}{3}\frac{\partial }{\partial x_{j}} (\rho k \delta _{ij})
Best regards
sasan.
lfgmarc likes this.
sasanghomi is offline   Reply With Quote

Old   June 27, 2013, 03:56
Default
  #9
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Iran - Tehran
Posts: 185
Rep Power: 4
sasanghomi is on a distinguished road
Quote:
Originally Posted by vwibaut View Post
The term with 2/3 rho k is present in the equation. It is taken into account in the pressure (in the equation p = ps + 2/3 rho k). The results you have, after simulations, give you a pressure wich contains the real pressure and turbulent kinetic energy.
Hi Valentin ,
Which file have this equation for pressure ?
Can you explain more and clarify the issue ?

Thanks and best regards,
Sasan.
sasanghomi is offline   Reply With Quote

Old   June 27, 2013, 04:12
Default
  #10
Member
 
Valentin Wibaut
Join Date: Oct 2012
Posts: 45
Rep Power: 4
vwibaut is on a distinguished road
You will not find this term because it is into the pressure term. More clearly, the pressure in your equation isn't the real pressure. It is the real pressure+ 2/3 rho k.

But it is close to the real pressure because k << p
lfgmarc and sasanghomi like this.
vwibaut 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
A question about UEqn sonicFoam lfgmarc OpenFOAM Programming & Development 6 February 1, 2015 17:49
sonicFoam not matching shock theory Alan OpenFOAM Running, Solving & CFD 15 June 27, 2013 07:10
Source term problem in UEqn of simpleFoam fisch OpenFOAM Programming & Development 1 June 17, 2011 10:57
Difference between codes and representations titio OpenFOAM Running, Solving & CFD 3 July 3, 2009 07:58
energy in sonicFoam joern OpenFOAM Running, Solving & CFD 0 June 16, 2009 15:53


All times are GMT -4. The time now is 03:05.