|
[Sponsors] |
Good old source term in a new transport equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 30, 2014, 10:44 |
Good old source term in a new transport equation
|
#1 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 15 |
Hi, just cross-checking with you guys:
Say I have this equation: "A" is a temperature dependent variable being computed, separately, via a header file. Wondering if the implementation of source term is correct? Code:
solve(fvm::ddt(X)+fvm::div(phi,X)-fvm::SuSp(AX,X)); |
|
January 5, 2015, 02:22 |
|
#2 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 15 |
Any suggestions would be really appreciated. I am impatiently waiting...!
thanks. |
|
January 9, 2015, 04:21 |
|
#3 | |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 15 |
For future reference:
Quote:
The way to deal with higher order source terms is to linearize them into Sc and Sp parts. I have applied Picard's method which is explained in detailed on page 57 of this document. For the problem mentioned above, this is how I have implemented it in OF and note that the subscript "o" is for the old value of a field, retrieved by oldTime() function. Step 1. Source term: Step 2. Taylor's expansion around the old value of X Step 3. Sc and Sp Step 4. Create two volScalarField(s) for Sc and Sp and using a forAll loop over the cells Code:
forAll(mesh.C(), celli) { X_valOld = X.oldTime()[celli] Su[celli] = -1.0*A*Foam::pow(X_valOld,2); Sp[celli] = 2.0*A*X_valOld; } Code:
fvScalarMatrix XEqn ( fvm::ddt(X) + fvm::div(phi,X) == Su + fvm::Sp(Sp,X) ); XEqn.solve(); I haven't run any test cases though! but for now there is no compilation errors. |
||
January 13, 2024, 15:05 |
|
#4 |
New Member
Ludwig Bossle
Join Date: Jan 2024
Location: Karlsruhe, Germany
Posts: 1
Rep Power: 0 |
I landed on this topic because I had stability issues caused by a very large source term. I couldn't perform a taylor linearization to solve my problem but this discussion more or less directed me to 'Numerical heat transfer and fluid flow' (Patankar 1980). Chapter 4.2-5 and especially 7.2 helped me enormously. So perhaps this can be of use to some for future reference.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
adding a constant volumetric source term to transport equation in a particular region | cfdonline2mohsen | OpenFOAM Programming & Development | 15 | February 16, 2017 09:55 |
implicit - scalar product source term in momentum equation | vinch | OpenFOAM Running, Solving & CFD | 0 | October 28, 2014 14:57 |
turbulent diffusion term in transport equation for additional variables | Raijin Thunderkeg | CFX | 2 | May 17, 2014 22:53 |
Source term energy equation for reactive flows | DaIN | Main CFD Forum | 0 | October 6, 2011 15:11 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 19:08 |