|
[Sponsors] |
Adding explict source terms in Runge-Kutta method |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 21, 2018, 12:49 |
Adding explict source terms in Runge-Kutta method
|
#1 |
Senior Member
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18 |
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 |
|
March 21, 2018, 13:02 |
|
#2 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71 |
Quote:
That depends on the linearity or non-linearity of the source term, if it is stiff, etc |
||
March 21, 2018, 13:12 |
|
#3 | |
Senior Member
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18 |
Quote:
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 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(); Kind Regards, Syavash |
||
March 21, 2018, 13:18 |
|
#4 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71 |
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.
|
|
March 21, 2018, 13:44 |
|
#5 | |
Senior Member
Syavash Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18 |
Quote:
Code:
4th step #include "pressureCorrection.H" //pressure correction U = U + deltaP * dt; //Ending line of the code Kind Regards, Syavash |
||
March 21, 2018, 13:52 |
|
#6 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71 |
Quote:
yes, you can also add it out of the RK4 steps |
||
|
|
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 |