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

simpleFoam with energy equation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 13, 2009, 13:49
Default simpleFoam with energy equation
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Hello world.

I'm dealing with a case in which Navier-Stokes and energy equation can be solved one after the other.

I have little experience in manipulating solvers, but I think it's possible to alter the simpleFoam solver for such a case.

So where do I put the energy equation?

As I want to compute temperature after successfully converged Navier-Stokes-Equation I have thought about opening another time-loop and solving the energy equation there.

Something like this:
Code:
   Info<< "\nStarting time loop\n" << endl;

    for (runTime++; !runTime.end(); runTime++)
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

#       include "readSIMPLEControls.H"
#       include "initConvergenceCheck.H"

        p.storePrevIter();

        // Pressure-velocity SIMPLE corrector
        {
#           include "UEqn.H"
#           include "pEqn.H"
        }

        turbulence->correct();

        runTime.write();

        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;

#       include "convergenceCheck.H"
    }

#include 'TEqn.H'

    Info<< "End\n" << endl;

    return(0);
TEqn.H will contain the energy equation. So much for the basics of this problem.

Thanks for your ideas. See you.
Sebastian
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   October 14, 2009, 03:57
Default
  #2
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 171
Rep Power: 7
markusrehm is on a distinguished road
Hi Sebastian,

have a look at buoyantSimpleFoam.

Regards, Markus.
markusrehm is offline   Reply With Quote

Old   October 19, 2009, 15:04
Default
  #3
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
Quote:
Originally Posted by markusrehm View Post
Hi Sebastian,

have a look at buoyantSimpleFoam.

Regards, Markus.
I did and it looks to me that the enthalpy equation is solved inside the brackets with U and p.

So I will put the energy equation inside it too?

Code:
    {
#           include "UEqn.H"
#           include "pEqn.H"
#           include "TEqn.H"
        }
Just to make sure...
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   November 20, 2009, 15:21
Default
  #4
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 10
sega is on a distinguished road
It took some time before I got back to this construction site:

Do you think buoyantSimpleFoam for itself (without chaning anything) will be the right choice for a simple convective heat transfer problem?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   November 23, 2009, 03:31
Default
  #5
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 171
Rep Power: 7
markusrehm is on a distinguished road
It worked well for me. But you can take out the buoyancy term as well.

Markus
markusrehm is offline   Reply With Quote

Old   January 25, 2013, 16:05
Default TEqn.H
  #6
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 5
sdharmar is on a distinguished road
Hi Markus and Sebastian,

Why can't we put the TEqn.H out side the SIMPLE loop. I think we need to calculate temperature field after we got corrected velocity field. Is my idea right or wrong? And since simpleFoam calculates turbulent flows I put my Teqn.H as,

{

volScalarField kappaEff
(
"kappaEff",
turbulence->nu()/Pr + turbulence->nut()/Prt
);

fvScalarMatrix TEqn
(
//fvm::ddt(T)
fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);

TEqn.relax();

TEqn.solve();

//rhok = 1.0 - beta*(T - TRef);
}

Please correct me if I am wrong. My temperature value fluctuates a lot whenever I used it out side the SIMPLE loop. But in pisoFoam I put it in outside the PISO loop and worked really good.

Please advice me.

Best regards,
Suranga.
sdharmar is offline   Reply With Quote

Old   January 26, 2013, 07:42
Default
  #7
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 7
Hisham is on a distinguished road
Hi Suranga

I think the (rather old) discussion here was about the time loop not the Simple/pimple loop. Naturally one needs to keep the algorithm for the Navier-Stokes equations intact. You can add whatever equation outside the algorithm to let it resole the pressure-velocity coupling in peace. Of course all equations should be inside the time loop unless you need to solve an equation once.


Hisham
Hisham 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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
Need help:about energy equation in CFX Stein CFX 4 July 2, 2009 23:31
SIMPLE and energy equation convergence Fabio Main CFD Forum 0 June 1, 2007 07:06
question about energy equation zhou FLUENT 0 February 24, 2004 00:55


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