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

add a pssive scalar in turbulent flow

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 2 Post By zxj160
  • 2 Post By morard
  • 1 Post By morard
  • 1 Post By sdharmar
  • 3 Post By morard

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2012, 12:59
Default add a pssive scalar in turbulent flow
  #1
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
Dear foamers,

How to add a passive scalar transport equation in the turbulent flow (I use LES)? Is there any tutorials for this problem?
amuzeshi and niro2016 like this.
zxj160 is offline   Reply With Quote

Old   June 14, 2012, 15:14
Default
  #2
Senior Member
 
niaz's Avatar
 
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 16
niaz is on a distinguished road
you can do the same thing in your code

{
fvScalarMatrix hEqn
(
fvm::ddt(rho, h)
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
dpdt
- (fvc::ddt(rho, K) + fvc::div(phi, K))
);

hEqn.relax();
hEqn.solve();

thermo.correct();
}
define alphaEff() firstly then use it.
niaz is offline   Reply With Quote

Old   June 15, 2012, 02:44
Default
  #3
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16
morard is on a distinguished road
Hi,

for a passive scalar you just have to write transport equation for it:

volScalarField kappaEff
(
"kappaEff",
nu/Pr + sgsModel->nut()/Prt
);

fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);

call this, for example, TEqn.H and include it into your solver:

#include "TEqn.H"


Here, Pr is your Prandtl number, or Schmidt number, or whatever you want, and
you have to add this to the readTransportProperties.H

dimensionedScalar Pr
(
transportProperties.lookup("Pr")
);

dimensionedScalar Prt
(
transportProperties.lookup("Prt")
);

There is also one very nice tutorial:

http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

Regards,
Dejan
sbusmayer and amuzeshi like this.
morard is offline   Reply With Quote

Old   June 15, 2012, 08:03
Default
  #4
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
sgsModel->nut()/Prt


Regards,
Dejan[/QUOTE]

Many thanks. And what does the 'sgsModel->nut()/Prt' mean? And also the turbulent-> alphaEff()?
zxj160 is offline   Reply With Quote

Old   June 15, 2012, 09:26
Default
  #5
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16
morard is on a distinguished road
'sgsModel->nut()/Prt' is turbulent diffusivity

sgsModel->nut() returns turbulent viscosity which is calculated inside your LES model

and

turbulent-> alphaEff() is effective diffusivity (turbulent + molecular).

You need turbulent diffusivity because you model turbulent scalar flux as a product
of turbulent diffusivity and a gradient of a filtered field.
amuzeshi likes this.
morard is offline   Reply With Quote

Old   June 15, 2012, 11:43
Default
  #6
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
Many thanks. Make sense.
zxj160 is offline   Reply With Quote

Old   October 31, 2012, 00:37
Default Adding Temperature equation to PimpleFoam
  #7
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi Dejan and Foamers,

I am trying to add Temperature equation to pisoFoam solver to do LES. I found two differnt ways of writing TEqn.H

kappat = turbulence->nut()/Prt;
kappat.correctBoundaryConditions();
volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);
TEqn.relax();
TEqn.solve();

and

{
volScalarField kappaEff
(
"kappaEff",
turbulence->nu()/Pr + turbulence->nut()/Prt
);
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);
TEqn.relax();
TEqn.solve();
}

Is there any difference between those two?
Where should I include the TEqn.H? Inside the PISO loop or after the corrector step?
I have seen some users in this forum have suggested to specify "kappaEff" in createFields.H file in the same way we do for T and p. In this case I think that we need to specify bounday conditions of kappaEff too.
Is this correct?
I am going to use Smagorinsky model for SGS modeling. I suppose that it is enough to specify U, p and T in the boundaries. It is so confusing to me that most of the tutorial cases specify nuSgs, nuTilda in the bounday.
What is the reason behind that?

Finally,

When we specify,
turbulence -> nut()/Prt

Does the solver know that nut=nuSgs for LES modeling?
Please help me.

Best regards,
Suranga.
amuzeshi likes this.
sdharmar is offline   Reply With Quote

Old   October 31, 2012, 03:59
Default
  #8
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16
morard is on a distinguished road
Hi Suranga,

there is no difference between those two ways, but if you ask me, use the second one. And usually you don't need TEqn.relax(); but I suppose that you can keep it if you want.

Include it after the PISO loop.

You can specify kappaEff in createFields.H and give it option IOobject::AUTO_WRITE,
so that you can post process it after the simulation is completed. You don't have to specify boundary conditions, and my personal opinion is that it's not necessary since the boundary conditions for kappa should be the same as for nu.

You are right, you don't have to specify nuTilda. It is required for some RAS models, but I can't remember which one.

Yes, solver knows that. Just check these lines in LESModel.H

//- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const
{
return nuSgs();
}

Regards,
Dejan
Kojote, ykanani and amuzeshi like this.
morard is offline   Reply With Quote

Old   October 31, 2012, 12:35
Default
  #9
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Dejan,

Thank you very much for your help. I did a simulation of pitzdaily tutorial by using tempPisoFoam ( the solver that I made including temperature field) and got unacceptable results for the temperature field. I have attached all the files for my test case and my new solver files herewith. Could you please see whether I am doing right or wrong.

I am sorry that I can not attache other files in the forum. If you can give me your other email I can send them too.

Best regards,
Suranga.
Attached Files
File Type: gz colorplots.tar.gz (80.8 KB, 33 views)
sdharmar is offline   Reply With Quote

Old   October 31, 2012, 17:26
Default
  #10
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi Dejan and others,

I solved the trouble. I will post all the things I did in this thread later. Thank you very much for your help.

Best regards,

Suranga.
sdharmar is offline   Reply With Quote

Old   November 1, 2012, 04:17
Default
  #11
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16
morard is on a distinguished road
Hi Suranga,

it's nice to hear that you have solved the problem.

Best regards,
Dejan
morard is offline   Reply With Quote

Old   January 27, 2013, 13:57
Default tempSimpleFoam.
  #12
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi everyone,

I am really sorry for not replying you earlier than this. You can find how I did modified the simpleFoam solver to solve temperature equation in the following thread.

http://www.cfd-online.com/Forums/ope...tml#post404356.

Please don't hesitate to give your comments. Your comments are always welcome.

BR,
Suranga.
sdharmar is offline   Reply With Quote

Old   January 26, 2019, 01:21
Default
  #13
New Member
 
priyesh kakka
Join Date: Jan 2018
Posts: 13
Rep Power: 8
kakkapriyesh is on a distinguished road
Quote:
Originally Posted by sdharmar View Post
Hi Dejan and Foamers,

I am trying to add Temperature equation to pisoFoam solver to do LES. I found two differnt ways of writing TEqn.H

kappat = turbulence->nut()/Prt;
kappat.correctBoundaryConditions();
volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);
TEqn.relax();
TEqn.solve();

and

{
volScalarField kappaEff
(
"kappaEff",
turbulence->nu()/Pr + turbulence->nut()/Prt
);
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(kappaEff, T)
);
TEqn.relax();
TEqn.solve();
}

Is there any difference between those two?
Where should I include the TEqn.H? Inside the PISO loop or after the corrector step?
I have seen some users in this forum have suggested to specify "kappaEff" in createFields.H file in the same way we do for T and p. In this case I think that we need to specify bounday conditions of kappaEff too.
Is this correct?
I am going to use Smagorinsky model for SGS modeling. I suppose that it is enough to specify U, p and T in the boundaries. It is so confusing to me that most of the tutorial cases specify nuSgs, nuTilda in the bounday.
What is the reason behind that?

Finally,

When we specify,
turbulence -> nut()/Prt

Does the solver know that nut=nuSgs for LES modeling?
Please help me.

Best regards,
Suranga.
hi, i guess this is similar to current buyoant Pimple Foam , my question is : If i am using LES along with it,will it filter TEqn? as LES does implicit filtering,and i want to use a test filter to implement variable prt in the code . any suggestion on how to do it?Thanks
kakkapriyesh is offline   Reply With Quote

Old   January 28, 2020, 12:11
Default Problems adding muEff either nuEff
  #14
Member
 
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9
rarnaunot is on a distinguished road
Hi Foamers,

I'm trying to do the same thing but in twoPhaseEulerFoam and RAS turbulence model. Has anyone tried it?

Thanks in advance,

Last edited by rarnaunot; January 29, 2020 at 03:16.
rarnaunot is offline   Reply With Quote

Reply

Tags
passive scalar


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
spectrum: LES of a turbulent channel flow finally goes to turbulent liu OpenFOAM Running, Solving & CFD 6 November 1, 2011 01:00
Difference between recirculation zone and turbulent flow region ashtonJ Main CFD Forum 0 September 16, 2011 03:46
Patch a bubble inside turbulent flow Helmi FLUENT 0 February 4, 2011 04:54
Turbulent flow through hexagonal circular pipe yogesh@cfd Main CFD Forum 0 November 9, 2010 23:10
Can 'shock waves' occur in viscous fluid flows? diaw Main CFD Forum 104 February 16, 2006 05:44


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