|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 ![]() |
Dear foamers,
How to add a passive scalar transport equation in the turbulent flow (I use LES)? Is there any tutorials for this problem? |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 ![]() |
sgsModel->nut()/Prt
Regards, Dejan[/QUOTE] Many thanks. And what does the 'sgsModel->nut()/Prt' mean? And also the turbulent-> alphaEff()? |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16 ![]() |
'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. |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 ![]() |
Many thanks. Make sense.
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Member
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Member
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16 ![]() |
Hi Suranga,
it's nice to hear that you have solved the problem. Best regards, Dejan |
|
![]() |
![]() |
![]() |
![]() |
#12 |
Member
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#13 | |
New Member
priyesh kakka
Join Date: Jan 2018
Posts: 13
Rep Power: 8 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#14 |
Member
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9 ![]() |
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. |
|
![]() |
![]() |
![]() |
Tags |
passive scalar |
|
|
![]() |
||||
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 |