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

continuity equation rhoEqn.H

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By dhumbird
  • 1 Post By dhumbird

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2017, 07:54
Default continuity equation rhoEqn.H
  #1
Member
 
Fridrik Magnusson
Join Date: Aug 2017
Location: Denmark
Posts: 34
Rep Power: 8
Fridrik is on a distinguished road
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:

\frac{\partial\rho}{\partial t}+\nabla\cdot\left(\rho\overline{u}\right)=0

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 }
Hopefully this can later be condensed into an introduction for other new users.

line 4-8 is somewhat defined in the ProgrammersGuide
http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf
Fridrik is offline   Reply With Quote

Old   November 10, 2017, 09:18
Default
  #2
New Member
 
Dave
Join Date: Dec 2014
Posts: 2
Rep Power: 0
dhumbird is on a distinguished road
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/.
mikulo likes this.
dhumbird is offline   Reply With Quote

Old   November 14, 2017, 04:24
Default
  #3
Member
 
Fridrik Magnusson
Join Date: Aug 2017
Location: Denmark
Posts: 34
Rep Power: 8
Fridrik is on a distinguished road
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 ?
Fridrik is offline   Reply With Quote

Old   November 14, 2017, 23:16
Default
  #4
New Member
 
Dave
Join Date: Dec 2014
Posts: 2
Rep Power: 0
dhumbird is on a distinguished road
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.
mikulo likes this.
dhumbird is offline   Reply With Quote

Reply

Tags
beginner, continuity equation, rhoeqn.h


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
I didn't find continuity equation satisified in multiphase analyses...... sanjiiv FLUENT 0 May 11, 2016 01:56
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
mixture mass continuity v.s. volumetric mixture continuity in pressure equation kaifu OpenFOAM 0 June 9, 2011 08:14
continuity equation Rafal Main CFD Forum 4 November 29, 2006 09:27
Poisson equation vs continuity equation DJ Main CFD Forum 1 August 5, 2004 20:01


All times are GMT -4. The time now is 23:33.