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

Regarding the energy equation(Internal energy equation) in the sonicFoam solver.

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By dlahaye
  • 1 Post By dlahaye

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2023, 22:26
Post Regarding the energy equation(Internal energy equation) in the sonicFoam solver.
  #1
New Member
 
Join Date: Jul 2022
Posts: 18
Rep Power: 3
applekiller is on a distinguished road
Hello,every Foamer, This is my first time posting a question in this community, and I am looking forward to everyone's answers.

I have a question about solving the energy equation (internal energy equation) in sonicFoam.

In EEqn.H of sonicFoam(I added some comments )
HTML Code:
    fvScalarMatrix EEqn                         
    (
        fvm::ddt(rho, e) + fvm::div(phi, e)
      + fvc::ddt(rho, K) + fvc::div(phi, K)
      + fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)") // fvc::absolute does nothing for static mesh
      - fvm::laplacian(turbulence->alphaEff(), e)   // turbulence->alphaEff() returns lambda/c_p or lambda/c_v depending on the solution variable e or h
            ==
        fvOptions(rho, e)
        );
The equation represented by this code seems to be
\frac{\partial \rho e}{\partial t} + \frac{1}{2}\frac{\partial \rho\pmb{u}^2}{\partial t} + \nabla\cdot(\rho e\pmb{u})+\frac{1}{2}\nabla\cdot(\rho \pmb{u}\pmb{u^2}) + \nabla\cdot(\pmb{u}p) + \nabla\cdot\pmb{q} = 0

In above equation
\pmb{u}^2 = \pmb{u}\cdot\pmb{u}
\pmb{q} = -\lambda\nabla T

e = C_v T

But if the total energy equation

\frac{\partial \rho E}{\partial t} + \nabla\cdot(\pmb{u}(\rho E+p)) - \nabla\cdot(\pmb{\tau}\cdot\pmb{u}) + \nabla\cdot \pmb{q} = 0

is expanded into the form of an internal energy equation, then the internal energy equation is like this.

\frac{\partial \rho e}{\partial t} + \frac{1}{2}\frac{\partial \rho\pmb{u}^2}{\partial t} + \nabla\cdot(\rho e\pmb{u})+\frac{1}{2}\nabla\cdot(\rho \pmb{u}\pmb{u^2}) + \nabla\cdot(\pmb{u}p) - \underline{\nabla\cdot(\pmb{\tau}\cdot\pmb{u})}+ \nabla\cdot\pmb{q} = 0

By comparing the internal energy equation represented in the code in OpenFOAM with the internal energy equation we derived, it can be seen that the internal energy equation solved in OpenFOAM lacks the viscous term-\nabla\cdot(\pmb{\tau\cdot\pmb{u}}).

So my question is,
1) Why does OpenFOAM omit the viscous term in solving the internal energy equation?
2) Does this handling have a significant impact on the results? (After all, the viscous term is missing from the internal energy equation)

I am looking forward to everyone's answer to this question and best wishes for everyone.
applekiller is offline   Reply With Quote

Old   May 16, 2023, 03:11
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 725
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Quote:
1) Why does OpenFOAM omit the viscous term in solving the internal energy equation?
The default OpenFoam implementation assumes that the effect of viscous dissipation is small. The additional computational cost to compute the viscous dissipation is thrown overboard. OpenFoam assumes this assumption to be satisfied in situations in which the solver is applied. OpenFoam assumes the user of the solver to verify the hypothesis or to at least raise healthy questions as you are doing.

Quote:
2) Does this handling have a significant impact on the results? (After all, the viscous term is missing from the internal energy equation).
Again, the hypothesis is that the effect of viscous dissipation is small. In situations in which viscous dissipation is important, it could be added using the fvOptions(rho,e) term.
Tobermory likes this.
dlahaye is online now   Reply With Quote

Old   May 16, 2023, 04:53
Default
  #3
New Member
 
Join Date: Jul 2022
Posts: 18
Rep Power: 3
applekiller is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
The default OpenFoam implementation assumes that the effect of viscous dissipation is small. The additional computational cost to compute the viscous dissipation is thrown overboard. OpenFoam assumes this assumption to be satisfied in situations in which the solver is applied. OpenFoam assumes the user of the solver to verify the hypothesis or to at least raise healthy questions as you are doing.



Again, the hypothesis is that the effect of viscous dissipation is small. In situations in which viscous dissipation is important, it could be added using the fvOptions(rho,e) term.
thanks for your timely reply!

Is this solver mainly used for supersonic flow? (So OpenFOAM defaults to a relatively low viscosity dissipation).
applekiller is offline   Reply With Quote

Old   May 16, 2023, 08:55
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 725
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Quote:
Is this solver mainly used for supersonic flow?
Yes and no.

Yes, sonicFoam is intended mainly for supersonic flows (hence the name).

No, however, rhoS/PimpleFoam also excluded viscous dissipation by default.
applekiller likes this.
dlahaye is online now   Reply With Quote

Old   May 16, 2023, 09:52
Default
  #5
New Member
 
Join Date: Jul 2022
Posts: 18
Rep Power: 3
applekiller is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
Yes and no.

Yes, sonicFoam is intended mainly for supersonic flows (hence the name).

No, however, rhoS/PimpleFoam also excluded viscous dissipation by default.
Can this be understood as OpenFOAM's default expectation for users to decide how to handle viscous term(for example, as you mentioned, add it to the fvOptions term)?

I have seen some OpenFOAM code where solvers sometimes lack some terms in discrete equations, which has been bothering me for a while.

Thank you very much for your answer !!!
applekiller is offline   Reply With Quote

Reply


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
How is strength value used in the Energy Equation of XiFoam solver? Manideep304 OpenFOAM Running, Solving & CFD 3 August 30, 2022 02:20
foam-extend-4.1 release hjasak OpenFOAM Announcements from Other Sources 19 July 16, 2021 05:02
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 06:33
modify a solver to account for energy equation. Yanci OpenFOAM Running, Solving & CFD 0 November 11, 2014 09:23
Why FVM for high-Re flows? Zhong Lei Main CFD Forum 23 May 14, 1999 13:22


All times are GMT -4. The time now is 12:34.