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

Add viscous stress term to sonicFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2016, 22:25
Default Add viscous stress term to sonicFoam
  #1
Member
 
Hilbert
Join Date: Aug 2015
Location: Australia
Posts: 50
Rep Power: 10
Hillie is on a distinguished road
Dear Foamers,

I am trying to add the viscous stress term to sonicFoam. Some people on this forum claimed that this has already been done. I have not been able to find it and therefore thought I would start a new thread.

The term that needs to be added to the energy equation is div(tau,U). I have read on this forum that the stress tensor tau should be directly available in the form of 'DevRhoReff'.


if I try to add the following term to the energy equation
Code:
fvc::div(DevRhoReff,U)
I get the following error: error:
Code:
DevRhoReff was not declared in this scope
Which I guess means that the variable is not defined. I am using kOmegaSST and in the source code I cannot find anything regarding the definition of the stress tensor.

If I work the stress term out for the energy equation I come to the following:
Code:
-fvc::div((turbulence->muEff()*(fvc::grad(U)) + turbulence->muEff()*dev2(fvc::grad(U)().T()))& U)
I am wondering if other people got the same term? sorry if this is a bit of a noob question, but this is the first time I am adding some code to OpenFoam and I just want to check if I am not making any noobis mistakes.
Hillie is offline   Reply With Quote

Old   April 11, 2016, 07:13
Default
  #2
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18
hk318i is on a distinguished road
Hello,

This variable, DevRhoRef, isn't available in the solver scope but you can get it from the turbulence object as follows;
Code:
turbulence->divDevRhoReff()
Generally, that's how to access any member function within the turbulence library. You have to check if this term is what you are looking for or not.
For more details about the governing equations in OF, please check this post http://www.cfd-online.com/Forums/ope...tml#post555624. Also, you can check the source code here [LINK].

Bw,
Hassan
hk318i is offline   Reply With Quote

Old   April 11, 2016, 21:15
Default
  #3
Member
 
Hilbert
Join Date: Aug 2015
Location: Australia
Posts: 50
Rep Power: 10
Hillie is on a distinguished road
Hi Hassan,
Thanks for your reply. My case is compressible. Looking at the compressible turbulence models the stress tensor is not available. (Or i am missing it). I guess the only option is to write the terms out and put that in. Cheers, Hilbert
Hillie is offline   Reply With Quote

Old   April 12, 2016, 04:40
Default
  #4
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18
hk318i is on a distinguished road
I think it is available for compressible flow because this function is defined as virtual function in the base class, check here [LINK].
hk318i is offline   Reply With Quote

Old   April 14, 2016, 02:53
Default
  #5
Member
 
Hilbert
Join Date: Aug 2015
Location: Australia
Posts: 50
Rep Power: 10
Hillie is on a distinguished road
Good point, thanks.
after a bit of playing with it I think I got it. The term I came up with is:

Code:
fvc::div(turbulence->devRhoReff()&U)
I haven't tested the code yet though.
Hillie 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 source term to UEqn.H KeiJun OpenFOAM Programming & Development 6 December 2, 2022 23:55
[PyFoam] and paraview eelcovv OpenFOAM Community Contributions 28 May 30, 2016 09:23
Add a source term (body force) in icoFoam hisham007 OpenFOAM Running, Solving & CFD 1 January 29, 2016 04:21
How to add a sink term to the transport equation for the volume fraction ASLAN_1987 STAR-CCM+ 2 September 14, 2015 21:57
how to add turbulent dispersion term in twoPhaseEulerFoam? Yucheng Fu OpenFOAM Running, Solving & CFD 2 April 28, 2015 00:04


All times are GMT -4. The time now is 20:15.