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

rhoPimpleFoam energy equation understanding problem he

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

Like Tree1Likes
  • 1 Post By mAlletto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2020, 08:04
Question rhoPimpleFoam energy equation understanding problem he
  #1
Member
 
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 6
superkelle is on a distinguished road
Hey,I looked into rhoPimpleFoam source code and I wonder about the energy equation. I have some questions for that.



1) Why is he.name() == "e" necessary?


2) I applied an fvOptions scalarCodedSource term to it, what was only possible on "e"
not on "he", but fvOptions(rho, he) is coded into the equation, and also the correction is called on "he" fvOptions.correct(he). Is that just because of 1) ?
scalarCodedSource fvOptions example moving heat source


3) Where does the temperature field "T" gets calculated, since it does not even get created in "createFields"? ( I think it has to be somehow implemented in the "thermo" functionality what is for me whitchcraft until now, I would be very happy for some advice to begin my research about "thermo")





Code:
{
    volScalarField& he = thermo.he();

    fvScalarMatrix EEqn
    (
        fvm::div(phi, he)
      + (
            he.name() == "e"
          ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
          : fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
        )
      - fvm::laplacian(turbulence->alphaEff(), he)
     ==
        fvOptions(rho, he)
    );

    EEqn.relax();

    fvOptions.constrain(EEqn);

    EEqn.solve();

    fvOptions.correct(he);

    thermo.correct();
}
It would be very nice if someone of you takes some time for answering, or even just giving some hints. Thank you in advance.
superkelle is offline   Reply With Quote

Old   May 28, 2020, 11:15
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
In openfoam you can either solve an equation for the internal energy ("e") or enthalpy ("he").



This is the if else statement in the energy equation.



Once solved the energy equation, the temperature is calculated in the termo package.


For the latter see https://caefn.com/openfoam/temperature-calculation
superkelle likes this.
mAlletto is offline   Reply With Quote

Old   May 28, 2020, 11:33
Default
  #3
Member
 
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 6
superkelle is on a distinguished road
Isn't it quite confusing that there is not a dummy variable instead of "he" ? So for example "x" that get set to "e" or "he" .
superkelle is offline   Reply With Quote

Old   July 12, 2020, 19:18
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
he is the dummy variable. Enthalpy is "h". In he.name() it is store, what is actually solved (e or h) and then the energy equation is modified accordingly. See : https://cfd.direct/openfoam/energy-equation/
jherb is offline   Reply With Quote

Reply

Tags
eeqn.h, rhopimpledymfoam, thermo

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't my simulation solve two energy equation? Roh FLUENT 12 April 18, 2019 11:33
Fluent do not use my velocity field(by UDF) to solve energy equation tangleiplus Fluent UDF and Scheme Programming 6 January 21, 2019 21:28
Convergence problem on the energy equation naruto5255 Fluent Multiphase 0 November 1, 2015 12:28
problem on energy and flow equation solving separately preetam69 FLUENT 2 July 30, 2013 21:08
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 11:31.