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

How to add speed of sound (c) into turbulent kinetic energy eqn

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2020, 08:19
Default How to add speed of sound (c) into turbulent kinetic energy eqn
  #1
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 400
Rep Power: 19
quarkz is on a distinguished road
Hi,

I need to modify the turbulent kinetic energy eqn. The new k formulation involves the speed of sound (c). I can compute c in the eqn using the formula c = sqrt(gamma*R*T), where gamma, R and T are specific heat ratios, gas constant and temperature. I also realise that there is a computation of c in rhoCentralFoam.C:

Code:
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
So my question is how do I call the value of c from rhoCentralFoam?

Or if using the 1st mtd, how do I call gamma, R and T?

What are the files which I must modify?

Being a newbie, I tried to add:

Code:
#include "psiThermo.H"
to my modified kOmegaSST.C (obtained using Prof Nilsson's tutorial)

and also add directories to my Make/options:

Code:
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
Although it compiled successfully, once I add things like thermo.Cp into the code, it complains:

error: ‘thermo’ was not declared in this scope

I also tried to add the line:

Code:
volScalarField c("c", sqrt(thermo.Cp()/thermo.Cv()*rPsi));
directly into my code but got the same error.

Any idea? Of cos, if possible, the 1st mtd seems much easier but I also have no idea how it can be implemented.

Last edited by quarkz; April 29, 2020 at 09:56.
quarkz is offline   Reply With Quote

Old   May 3, 2020, 17:19
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
what did you mean by calling c? you compute c inside rhoFoam and you it thereat?
HPE is offline   Reply With Quote

Old   May 3, 2020, 21:25
Default
  #3
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 400
Rep Power: 19
quarkz is on a distinguished road
Sorry I mean I need to obtain the value of c for calculation of turbulent kinetic energy eqn. Since I'll be running rhoCentralFoam with kOmegaSST, is it possible to get the current value of c while running rhoCentralFoam and feed it into the turbulent kinetic energy eqn?

Else, I would need to calculate c using the formula in the source file of the turbulent kinetic energy eqn:

thermo.Cp()/thermo.Cv()*rPsi
quarkz 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
Significance of turbulent kinetic energy oj.bulmer CFX 1 February 25, 2014 17:30
Turbulent kinetic Energy Cfd00d Main CFD Forum 2 December 5, 2013 15:30
CFX-POST : gradients for turbulent kinetic energy syler3321 CFX 1 June 16, 2011 05:47
turbulent kinetic energy and turbulent dissipation rate D_L Main CFD Forum 5 July 17, 2010 02:35
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45


All times are GMT -4. The time now is 17:59.