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

Add one term to simpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2021, 18:30
Cool Add one term to simpleFoam
  #1
New Member
 
Mattia Fabrizio Ciarlatani
Join Date: May 2020
Posts: 7
Rep Power: 5
mattiafc is on a distinguished road
Good morning foamers!

I have a problem that looks simple but I could use some help in solving it.
I need to add a term to simpleFoam. I want to add the term -\partial (k a_{ij}) /\partial x_{j} to the U equation, where k is the turbulent kinetic energy, which is computed from the RANS model, while a_{ij} is a symmTensorField which is stored into a file.

Adding a_{ij} to simpleFoam is trivial, as I just need to add some lines to createFeields.H similiar to the U declaration so that simpleFoam can read that file. At this point, I think that the declaration for computing -\partial (k a_{ij}) /\partial x_{j} should be -fvc::div(k*aij) .However, I don't know how to call the turbulent kinetic energy in simpleFoam from the turbulence model.
Does anyone have any suggestion on how to do this?

Thanks for your time,
Mattia
mattiafc is offline   Reply With Quote

Old   February 13, 2021, 03:57
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
Have you tried something like this:


Code:
turbulence->k()
mAlletto is offline   Reply With Quote

Old   February 15, 2021, 12:12
Default
  #3
New Member
 
Mattia Fabrizio Ciarlatani
Join Date: May 2020
Posts: 7
Rep Power: 5
mattiafc is on a distinguished road
Hi mAletto,

thanks for the swift reply. I am able to compile it with the instruction you suggest. I'll let you know if I'm able to run this modified simpleFoam as well.

Mattia
mattiafc is offline   Reply With Quote

Old   February 15, 2021, 17:58
Default
  #4
New Member
 
Mattia Fabrizio Ciarlatani
Join Date: May 2020
Posts: 7
Rep Power: 5
mattiafc is on a distinguished road
Hey Michael,

The solution you suggested seems to work. I had to resort to the same technique to call nu (turbulence->nu()) since in simpleFoam from v1906 there is no readTransportProperties.H.

Thank you so much!
Mattia
mattiafc 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
Add a mass source/sink to simpleFoam palarcon OpenFOAM Programming & Development 4 May 15, 2019 02:33
How to add a source term on the nodes of the cells amina.yacoubi Fluent UDF and Scheme Programming 4 February 19, 2019 18:25
How to add species source term through fvOptions blttkgl OpenFOAM Running, Solving & CFD 0 February 19, 2019 02:49
Add source term in alphaEqn.H of interFoam tayo OpenFOAM 1 October 23, 2013 03:40
How to add a summison term in the source code nakul OpenFOAM 6 November 9, 2010 05:36


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