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

SimpleFoam and Temperature Equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2013, 13:59
Default SimpleFoam and Temperature Equation
  #1
Member
 
Patrick Wollny
Join Date: Apr 2010
Posts: 58
Rep Power: 16
Pat84 is on a distinguished road
Hello,

I have add the enthalpy equation in temperature form to simpleFoam. The Equation has now this form:

Code:
fvScalarMatrix TEqn
        (
          fvm::div(phi, T)
        - fvm::Sp(fvc::div(phi),T)
        - fvm::laplacian(turbulence->nut()/0.85, T)
        - fvm::laplacian(DT,T)
    ==
          1/cp*fvc::div(phi*fvc::interpolate(p))
        - 1/cp*p*fvc::div(phi)
        );
    
        TEqn.relax();
        TEqn.solve();
The terms fvm::Sp(fvc::div(phi),T) and 1/cp*p*fvc::div(phi) are there to take account of partial convergence in simpleFoam. The Value 0.85 represents the turbulent prandtl number and DT is equal to k/cp/rho since the whole equation is divided by rho*cp.

The equation is added to simpleFoam.c in after the pressure correction:

Code:
    while (runTime.loop())
    {
        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();

#       include "TEqn.H"

        runTime.write();

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

#       include "convergenceCheck.H"
    }

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

    return 0;
}
The code works fine, but the results are not - as expected - in agreement with the results calculated by fluent, cfx with constant rho and rhoSimpleFoam.

The difference between the result of fluent and my code is shown by the picture below, where the upper is result is my code and the result below was calculated by fluend - the result of fluent is equal to cfx and rhoSimpleFoam.



Can someone tell me what´s wrong with my code? I´ve tested the temperature equation with and without the terms "1/cp*fvc::div(phi*fvc::interpolate(p)) - 1/cp*p*fvc::div(phi)" since this is an incompressible case, there is no big difference.

The div and grad schemes are 1st order upwind and least squares in all cases. The velocity field is in very close agreement with the other calculations.

Best regards,
Patrick
Attached Images
File Type: jpg temp.jpg (31.1 KB, 500 views)
Pat84 is offline   Reply With Quote

Old   August 9, 2013, 09:04
Default
  #2
Member
 
Patrick Wollny
Join Date: Apr 2010
Posts: 58
Rep Power: 16
Pat84 is on a distinguished road
No idea?
This is strange

btw. the temperature BC at the wall is zeroGradient

Last edited by Pat84; August 9, 2013 at 11:52.
Pat84 is offline   Reply With Quote

Old   June 10, 2014, 15:04
Default
  #3
New Member
 
Lee
Join Date: Oct 2011
Posts: 15
Rep Power: 15
SKLee is on a distinguished road
Hi Patrick,

Have you solved your problem ? and you can share me your code adding temperature equation into simpleFoam ?

Lee
SKLee is offline   Reply With Quote

Old   June 11, 2014, 02:51
Default
  #4
Senior Member
 
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 16
ybapat is on a distinguished road
Hello,

Can you just check if your energy equation is fully converged? What URF are you using for energy equation?

Regards,
-Yogesh
ybapat is offline   Reply With Quote

Old   June 12, 2014, 11:48
Default
  #5
New Member
 
Lee
Join Date: Oct 2011
Posts: 15
Rep Power: 15
SKLee is on a distinguished road
Hi Yogesh,

URF = 0.15 ;

The energy equation seems not to be fully converged. Have you tried this for your cases ? What are you experiencing this problem ?

SKLee
SKLee is offline   Reply With Quote

Old   June 16, 2014, 01:43
Default
  #6
Senior Member
 
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 16
ybapat is on a distinguished road
Hello,

I think you should try with much larger under-relaxation and make sure that energy equation is converged.

-Yogesh
ybapat 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
adding temperature to simpleFoam waters OpenFOAM Programming & Development 80 May 30, 2017 22:30
simpleFoam temperature blows up tellico OpenFOAM Running, Solving & CFD 0 June 24, 2013 14:19
simpleFoam with energy equation sega OpenFOAM Programming & Development 6 January 26, 2013 07:42
Temperature in simpleFoam takes lots of Iterations okroud OpenFOAM Running, Solving & CFD 5 October 19, 2012 02:35
Transport Equation for temperature variance ameya OpenFOAM Running, Solving & CFD 0 December 5, 2008 02:16


All times are GMT -4. The time now is 07:46.