CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Adding explict source terms in Runge-Kutta method

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By FMDenaro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2018, 12:49
Default Adding explict source terms in Runge-Kutta method
  #1
Senior Member
 
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Dear All,

How should I add an explicit source term to momentum equation in the incompressible explicit 4th-order runge-kutta method? I have already implemented the method but I can't be sure about the details of adding a source term. At the moment, I have added the explicit source term at the end of the 4th step by adding the source to the velocity quantity, right before solving the Poisson equation for pressure. However, I wonder if it is the correct place.
Please help me to find the answer, possibly by introducing an appropriate reference addressing the issue.

Kind Regards,
Syavash
syavash is offline   Reply With Quote

Old   March 21, 2018, 13:02
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by syavash View Post
Dear All,

How should I add an explicit source term to momentum equation in the incompressible explicit 4th-order runge-kutta method? I have already implemented the method but I can't be sure about the details of adding a source term. At the moment, I have added the explicit source term at the end of the 4th step by adding the source to the velocity quantity, right before solving the Poisson equation for pressure. However, I wonder if it is the correct place.
Please help me to find the answer, possibly by introducing an appropriate reference addressing the issue.

Kind Regards,
Syavash

That depends on the linearity or non-linearity of the source term, if it is stiff, etc
FMDenaro is offline   Reply With Quote

Old   March 21, 2018, 13:12
Default
  #3
Senior Member
 
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
That depends on the linearity or non-linearity of the source term, if it is stiff, etc
Thanks Prof. Denaro for your quick response. It is a simple constant source which is supposed to drive the flow inside a planar channel for LES.

The implementation is like the following:

Code:
//4th step
        U = U + deltaP * dt;          //deltaP is the source vector
        phi = (fvc::interpolate(U) & mesh.Sf());
        dU = dt*(fvc::laplacian(turbulence->nuEff(), U) - fvc::div(phi,U)); //nuEff is the summation of nuLam and nuSgs
        Uc = Uc +b4*dU; U = Uc;
        #include "pressureCorrection.H"    //pressure correction
The file pressureCorrection.H contains the following lines:
Please note that pEqn is the laplacian of pressure.

Code:
U.correctBoundaryConditions();
solve(pEqn == fvc::div(U)/runTime.deltaT());
U = U - (fvc::grad(p) * runTime.deltaT());
U.correctBoundaryConditions();
Is this the correct implementation?

Kind Regards,
Syavash
syavash is offline   Reply With Quote

Old   March 21, 2018, 13:18
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
if this is the constante pressure gradient that drives the main flow you just add at the end the term dt*grad p, this an exact integration.
FMDenaro is offline   Reply With Quote

Old   March 21, 2018, 13:44
Default
  #5
Senior Member
 
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
if this is the constante pressure gradient that drives the main flow you just add at the end the term dt*grad p, this an exact integration.
Thanks. Let me ask if I got it right. You mean something like the following in the 4th step:

Code:
4th step
        #include "pressureCorrection.H"    //pressure correction

         U = U + deltaP * dt;                 //Ending line of the code
In other words, should it not be included in the pressure correction equation?

Kind Regards,
Syavash
syavash is offline   Reply With Quote

Old   March 21, 2018, 13:52
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by syavash View Post
Thanks. Let me ask if I got it right. You mean something like the following in the 4th step:

Code:
4th step
        #include "pressureCorrection.H"    //pressure correction

         U = U + deltaP * dt;                 //Ending line of the code
In other words, should it not be included in the pressure correction equation?

Kind Regards,
Syavash

yes, you can also add it out of the RK4 steps
syavash likes this.
FMDenaro 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
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


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