add a pssive scalar in turbulent flow
Dear foamers,
How to add a passive scalar transport equation in the turbulent flow (I use LES)? Is there any tutorials for this problem? 
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. 
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 
sgsModel>nut()/Prt
Regards, Dejan[/QUOTE] Many thanks. And what does the 'sgsModel>nut()/Prt' mean? And also the turbulent> alphaEff()? 
'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. 
Many thanks. Make sense.

Adding Temperature equation to PimpleFoam
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 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 
1 Attachment(s)
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. 
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. 
Hi Suranga,
it's nice to hear that you have solved the problem. Best regards, Dejan 
tempSimpleFoam.
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.cfdonline.com/Forums/ope...tml#post404356. Please don't hesitate to give your comments. Your comments are always welcome. BR, Suranga. 
All times are GMT 4. The time now is 10:11. 