CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   sonicFoam #include[s] rhoEqn.H... (https://www.cfd-online.com/Forums/openfoam-programming-development/72237-sonicfoam-include-s-rhoeqn-h.html)

thekay January 29, 2010 11:21

sonicFoam #include[s] rhoEqn.H...
 
...but the rhoEqn.H cannot be found in the solver directory (version 1.6). I was curious when I was using the solver before, it gave results for everything, but the rho was always calculated as 0. Does anybody know the purpose of this? Is this intentional? Can I incorporate some other rhoEqn.H easily?

l_r_mcglashan January 29, 2010 12:55

It's in the folder OpenFOAM-1.6.x/src/finiteVolume/cfdTools/compressible.

thekay February 15, 2010 10:14

Revisiting this thread after some time:

I am running a case at the moment, using sonicFoam. The case is pretty much the same as /home/username/OpenFOAM/OpenFOAM-1.6/tutorials/compressible/sonicFoam/ras/prism/ but instead of "prismWall", I have "wall" which is the wall of my domain. While running, in each time step, I get:

Code:

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
Obviously I don't have a rho file in 0/ but even if I do, I get the same output for rho.

My questions are:

  1. Can I get sonicFoam to solve for rho as well?
  2. Why is the above output produced? In no tutorial it solves for rho, so I am curious if it was just left there from another solver.
Thank you.

mecbe2002 April 26, 2010 13:57

Hi,

Any solution for this problem.

RicMat October 30, 2013 05:17

Probably you need to supply an equation of state in your case dir? that is dont you need a thermoPhysicalProperties dict? I cant say for shure as I am looking at engineFoam and rhoPimpleFOAM at the moment, but that seems to be what's happening there. rhoEqn.h is just the mass conservation equation.

JasonWang3 March 18, 2015 12:58

Quote:

Originally Posted by thekay (Post 246075)
Revisiting this thread after some time:

I am running a case at the moment, using sonicFoam. The case is pretty much the same as /home/username/OpenFOAM/OpenFOAM-1.6/tutorials/compressible/sonicFoam/ras/prism/ but instead of "prismWall", I have "wall" which is the wall of my domain. While running, in each time step, I get:

Code:

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
Obviously I don't have a rho file in 0/ but even if I do, I get the same output for rho.

My questions are:

  1. Can I get sonicFoam to solve for rho as well?
  2. Why is the above output produced? In no tutorial it solves for rho, so I am curious if it was just left there from another solver.
Thank you.

I met the same situation. sonicFoam is a pressure based solver, and the element of density don't need to solve alone. So that's maybe the reason of rho=0.
But still don't know how to get the rho values of the fields, two options:
1. state equation
2. phi=rho*velocity*A

Lisandro Maders October 2, 2015 10:18

Solved?
 
Do you guys solved this issue? Why is rho equation not being calculated?

JasonWang3 October 5, 2015 06:27

Hi Maders
Try to add these extra sentence at the end of controlDict, and the rho will output in the calculation folder.
Quote:

functions
{
rhofunc
{
type writeRegisteredObject;
functionObjectLibs ("libIOFunctionObjects.so");
outputControl outputTime;
outputInterval 1;
objectNames
(
"rho"
);
}
}

Lisandro Maders October 5, 2015 07:13

Worked!
 
Quote:

Originally Posted by JasonWang3 (Post 566553)
Hi Maders
Try to add these extra sentence at the end of controlDict, and the rho will output in the calculation folder.

Hi Wang,

that worked! I have already done it by inserting write() functions at runTime, but I found your way more straightforward.. Thanks!:)

Lisandro Maders October 5, 2015 07:18

Actually the answer is..
 
Actually the main answer iin this topic was about the rho calculation.. That seemed not to be doing by the "0" values of iterations and residuals. Here is the aswer, which is very logic by the way: http://www.cfd-online.com/Forums/ope...opisofoam.html

Regards, Lisandro

kcp18 June 8, 2016 17:45

Additional note
 
I would just like to add to this that by adding the rho function I was able to use the R utility to compute Reynolds stress when using the sonicFoam solver. This was very helpful if you are using some other turbulence model at the start of the solution with the intent to switch to LRR model after the flow field has been initialized.


All times are GMT -4. The time now is 19:40.