|
[Sponsors] |
November 6, 2017, 08:54 |
continuity equation rhoEqn.H
|
#1 |
Member
Fridrik Magnusson
Join Date: Aug 2017
Location: Denmark
Posts: 34
Rep Power: 9 |
Hallo everyone
im trying to learn about OpenFoam, and by that i would like to explore the continuity equation. But my source-code-reading-skills is not the best. This post is made to disect the continuity equation from an absolut beginners point of view. Where the continuity equation is: I have posted the rhoEqn.H below, which might be the most generally implementation of the continuity equation. Where it is unknown what the line 7, 9, 10 and 11 does. Code:
1{ 2 fvScalarMatrix rhoEqn //Class called rhoEqn 3 ( 4 fvm::ddt(rho) //generates the implicit (fvm) first order time derivative (ddt) 5 + fvc::div(phi) // adds the explicit (fvc) divergence of phi, where phi = rho*u 6 == 7 fvOptions(rho) // compares to the acceptable error in fvSolution ? 8 ); 9 fvOptions.constrain(rhoEqn); // Give solution criteria ? 10 rhoEqn.solve(); // Acturally solves the equation ? 11 fvOptions.correct(rho); // rewrite the code ? 12 } line 4-8 is somewhat defined in the ProgrammersGuide http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf |
|
November 10, 2017, 10:18 |
|
#2 |
New Member
Dave
Join Date: Dec 2014
Posts: 2
Rep Power: 0 |
fvOptions allows one to manipulate certain fields outside of the solver. Line 7 is a direct source/sink term, lines 9 and 11 impose a constraint on the equation (before solution) or a correction on the field (after solution). These lines won't do anything unless the user has written some fvOptions code and placed it in constant/.
|
|
November 14, 2017, 05:24 |
|
#3 |
Member
Fridrik Magnusson
Join Date: Aug 2017
Location: Denmark
Posts: 34
Rep Power: 9 |
dhumbird, thanks for getting me one step closer to the answer
your answer leads to further questions ? line 7: fvOptions(rho) - pulls infomation from fvSolution and fvSchemes through the function fvOptions ? line 9: What kind of constraint? line 11: What kind of correction ? |
|
November 15, 2017, 00:16 |
|
#4 |
New Member
Dave
Join Date: Dec 2014
Posts: 2
Rep Power: 0 |
Fridrik,
At each of the fvOptions lines, the user can insert code without re-writing the solver. The code goes in a new file called constant/fvOptions. This is *advanced* OpenFOAM, so from an "absolute beginner's" perspective, these lines can be ignored. (Line 7 will return a 0, Lines 9 and 11 do nothing.) If/when you need this functionality, there are lots of hints here in the forum. |
|
Tags |
beginner, continuity equation, rhoeqn.h |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I didn't find continuity equation satisified in multiphase analyses...... | sanjiiv | FLUENT | 0 | May 11, 2016 02:56 |
Floating point exception error | lpz_michele | OpenFOAM Running, Solving & CFD | 53 | October 19, 2015 03:50 |
mixture mass continuity v.s. volumetric mixture continuity in pressure equation | kaifu | OpenFOAM | 0 | June 9, 2011 09:14 |
continuity equation | Rafal | Main CFD Forum | 4 | November 29, 2006 10:27 |
Poisson equation vs continuity equation | DJ | Main CFD Forum | 1 | August 5, 2004 21:01 |