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

simpleFoam Fatal Error: Could not find rho:rho

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2022, 23:12
Default simpleFoam Fatal Error: Could not find rho:rho
  #1
GDS
New Member
 
GS
Join Date: Sep 2018
Posts: 21
Rep Power: 7
GDS is on a distinguished road
I cannot figure out why I keep getting this error. From previous posts, this usually happens because rho is not defined in the controlDict file, but I did define it there.


Screen output:


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: convergence criteria
field p tolerance 1e-06
field U tolerance 1e-05
field "(k|omega|e)" tolerance 1e-05

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model SpalartAllmaras
Selecting patchDistMethod meshWave
SpalartAllmarasCoeffs
{
Cb2 0.622;
Cb1 0.1355;
kappa 0.41;
sigmaNut 0.66666;
Cw3 2;
Cv2 5;
Cw2 0.3;
Cv1 7.1;
Cs 0.3;
}

No MRF models present

No finite volume options present

Starting time loop

forces forces1:
Not including porosity effects

forceCoeffs forceCoeffs:
p: p
U: U
rho: rhoInf
Freestream density (rhoInf) set to 1
Not including porosity effects

Time = 1

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.04419339, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.074409196, No Iterations 2
smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 0.043509528, No Iterations 4
GAMG: Solving for p, Initial residual = 1, Final residual = 0.051297006, No Iterations 4
time step continuity errors : sum local = 0.00010679296, global = 7.7896282e-06, cumulative = 7.7896282e-06
smoothSolver: Solving for nuTilda, Initial residual = 0.99999991, Final residual = 0.077435556, No Iterations 3
ExecutionTime = 179.44 s ClockTime = 181 s



--> FOAM FATAL ERROR:
Could not find rho:rho

From void Foam::functionObjects::forces::initialise()
in file forces/forces.C at line 235.

FOAM exiting
Attached Files
File Type: txt controlDict.txt (2.6 KB, 34 views)
GDS is offline   Reply With Quote

Old   January 20, 2022, 03:20
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,076
Rep Power: 26
Yann will become famous soon enough
Hi,

You have defined rho in the forceCoeffs function object, but not in forces1 function. You need to define it there too.

Yann
Yann is offline   Reply With Quote

Old   January 22, 2022, 15:16
Default
  #3
GDS
New Member
 
GS
Join Date: Sep 2018
Posts: 21
Rep Power: 7
GDS is on a distinguished road
Thanks, that worked. I don't understand, though. I was using the case files from an example that solved with rhoSimpleFoam, and that ran with no problem.
GDS is offline   Reply With Quote

Old   January 23, 2022, 09:44
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,076
Rep Power: 26
Yann will become famous soon enough
Since simpleFoam is an incompressible solver, it doesn't compute rho. But you need to know rho is order to compute the forces, this is why you need to define it in the forces function objects.

rhoSimpleFoam is a compressible solver, rho is computed by the solver and retrieved by the forces function object to compute the forces.

This is why your function object definition works with rhoSimpleFoam and not with simpleFoam.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   July 27, 2023, 14:30
Default
  #5
New Member
 
Prayan
Join Date: Jun 2023
Posts: 10
Rep Power: 2
pranay10 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Since simpleFoam is an incompressible solver, it doesn't compute rho. But you need to know rho is order to compute the forces, this is why you need to define it in the forces function objects.

rhoSimpleFoam is a compressible solver, rho is computed by the solver and retrieved by the forces function object to compute the forces.

This is why your function object definition works with rhoSimpleFoam and not with simpleFoam.

Cheers,
Yann
Hey Yann,
I am using simplefoam for power law fluid. Pressure output in openfoam is kinematic. So what is the rho in this case? and how do I change that rho?
pranay10 is offline   Reply With Quote

Old   July 28, 2023, 03:39
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,076
Rep Power: 26
Yann will become famous soon enough
Hello pranay10,

The power law model is only used to compute viscosity.
OpenFOAM does not always use kinematic pressure (only for incompressible solvers)
simpleFoam indeed uses kinematic pressure so it doesn't need rho and this is why it is not defined anywhere. (and this is also why you need to define it explicitly in the forces function object, as it requires a rho value to compute the forces)

So to answer your question: rho is whatever value you want it to be and you don't need to define it to run simpleFoam. Just remember to multiply the pressure p calculated by simpleFoam by rho in order to get the static pressure. (or use the pressure function object to automatically compute fields like static and total pressure. You will have to define rho in the function object definition)

Cheers,
Yann
Yann is offline   Reply With Quote

Old   July 28, 2023, 04:41
Default
  #7
New Member
 
Prayan
Join Date: Jun 2023
Posts: 10
Rep Power: 2
pranay10 is on a distinguished road
Yann,
Thank You for the response.
I have a doubt since simpleFoam uses kinematic pressure (p/rho), then what is the default value of rho in this case? As without a rho being defined, it's not possible to do calculations right? I read through the documentation and code as well but coulnd't find it.
pranay10 is offline   Reply With Quote

Old   July 28, 2023, 04:49
Default
  #8
New Member
 
Prayan
Join Date: Jun 2023
Posts: 10
Rep Power: 2
pranay10 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello pranay10,

The power law model is only used to compute viscosity.
OpenFOAM does not always use kinematic pressure (only for incompressible solvers)
simpleFoam indeed uses kinematic pressure so it doesn't need rho and this is why it is not defined anywhere. (and this is also why you need to define it explicitly in the forces function object, as it requires a rho value to compute the forces)

So to answer your question: rho is whatever value you want it to be and you don't need to define it to run simpleFoam. Just remember to multiply the pressure p calculated by simpleFoam by rho in order to get the static pressure. (or use the pressure function object to automatically compute fields like static and total pressure. You will have to define rho in the function object definition)

Cheers,
Yann
Yann,
Thank You for the response.
I have a doubt since simpleFoam uses kinematic pressure (p/rho), then what is the default value of rho in this case? As without a rho being defined, it's not possible to do calculations right? I read through the documentation and code as well but coulnd't find it.
pranay10 is offline   Reply With Quote

Old   July 28, 2023, 05:32
Default
  #9
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,076
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by pranay10 View Post
I have a doubt since simpleFoam uses kinematic pressure (p/rho), then what is the default value of rho in this case? As without a rho being defined, it's not possible to do calculations right?
This is the other way around: since simpleFoam is an incompressible solver, rho is constant and you can totally remove it from the equations you solve. This is what is done in simpleFoam, and as a consequence the pressure field ends up being normalized by rho. simpleFoam uses the kinematic pressure in order to totally get rid of rho in the equations it solves. (so there is no default value, there is no rho at all)

The value of p by itself does not matter in simpleFoam, only the pressure difference matters.
Yann is offline   Reply With Quote

Reply


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
FOAM FATAL ERROR: Cannot find file "points" in directory "shell/polyMesh" amol_patel OpenFOAM Pre-Processing 22 October 29, 2021 13:34
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
[Commercial meshers] FOAM FATAL ERROR Cannot find match for face 4 chrisegerer OpenFOAM Meshing & Mesh Conversion 8 April 7, 2008 10:15
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 20:30
[blockMesh] FOAM FATAL ERROR Cannot find file points in directory constantpolyMesh evgenii OpenFOAM Meshing & Mesh Conversion 2 October 9, 2006 15:27


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