
[Sponsors] 
September 22, 2011, 10:27 
Turbulent Prandtl Number

#1 
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8 
Hello to all,
I am trying to implement varying turbulent prandtl number in my simulation like it has been written in paper from Lilly ("A proposed modification of the Germano subgridscale closure method")  eq (17). As a basic, I want to use dynSmagorinsky model (OF 1.7.1). For that purpose I have to read temperature field, but I have some problems in doing that. Does anybody now how to read Temperature field into this model? I have tried to use something like: volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); but this does not work. Does anybody has an idea? Regards, Dejan 

September 22, 2011, 11:54 

#3 
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8 
Hi nima and thanks for replay,
I didn't compile it. What I did is: in the dynSmagorinsky.H I have added the following function: virtual tmp<volScalarField> Temperature() const { volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); return T; } Of course, this doesn't work. This was just try to see what will happen. I think virtual function to do this should be declared much earlier, probably in LESmode or turbulenceModel. The second way I am trying to solve this is to change constructor in LESmodel and to use something like: LESModelPrandtl ( const word& type, const volVectorField& U, const volScalarField& T, const surfaceScalarField& phi, transportModel& lamTransportModel ); note that const volScalarField& T, is the only difference from the original one. This also doesn't go and I think that turbulenceModel should be changed on this way. But, I do not want to play around with this. Anyway, now I would like to now is this approach is the right one. I think it is not necessary to post errors, since I had a lot. If I had managed to change model on this way, than I would simply in the file createFields (of my solver) write the following: autoPtr<incompressible::LESModel> sgsModel ( incompressible::LESModel::New(U, T, phi, laminarTransport) ); and that's it. What do you think, is this good approach? 

September 23, 2011, 02:03 

#5 
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 14 
This approach is the most general one, but if you want to have T in only one of your own models, then I know that there is a much easier way, unfortunately, I don't have any syntax for you.
But, if you're using the dynSmagorinsky model of 1.7.1 I won't bother implementing this and just base the turbulent Prandtl number on the eddy viscosity. The reason is that the 1.7.1 dynSmagorinsky model is not the model by Lilly, since the Smagorinsky constant is averaged over the whole domain. As you're using this model, imho it does not make sence to use localized variables of the turbulent Prandtl number. If you're interesting in an approach like Lilly's, please have a look at: Improved implementation of dynamic Smagorinsky 

September 23, 2011, 03:24 

#6  
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8 
Quote:
Yes, I want to have T just in one model. I have adjusted turbulenceModel, unfortunately I still have some errors so I haven't finished yet, but I think I can fix it and at the I'll have what I wanted. But, as you said, I believe that there must be a much easier way. Actually I need just idea from Lilly and I wanted to implement it in dynSmagorinsky because it seemed not so complicated. After that I want to spread this to some other models which I use more often, 

September 23, 2011, 10:08 

#8 
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8 

September 29, 2011, 09:53 

#9 
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 8 
Hi again,
I have implemented Prandtl number calculation in dynOnEqEddy model. As a basic I used paper from Lilly, but instead of calculating PrSgs locally, I use averaging as it is done in dynSmagorinsky. Model calculates PrSgs at each time step. Also I had to make some necessary changes in turbulenceModel, LESModel (in constructors and some functions). Nima and Bernhard, thanks again. Main changes in dynEqEddy are these: void dynOneEqEddyPrandtl::updateSubGridScaleFields(cons t volSymmTensorField& D) { nuSgs_ = ck(D)*sqrt(k_)*delta(); nuSgs_.correctBoundaryConditions(); PrSgs_ = 2*c1(D).value()/c2(D).value(); } and dimensionedScalar dynOneEqEddyPrandtl::c1(const volSymmTensorField& D) const { volSymmTensorField LL = dev(filter_(sqr(U())) + sqr(filter_(U()))); volSymmTensorField MM = sqr(delta())*(4*mag(filter_(D))*filter_(D)  filter_(mag(D)*(D))); dimensionedScalar MMMM = average(magSqr(MM)); if (MMMM.value() > VSMALL) { return average(LL && MM)/MMMM; } else { return 1.0; } } dimensionedScalar dynOneEqEddyPrandtl::c2(const volSymmTensorField& D) const { volVectorField PP = filter_(T()*U()) + (filter_(T())*filter_(U())); volVectorField RR = sqr(delta())*(4*mag(filter_(D))*fvc::grad(filter_( T()))  filter_(mag(D)*fvc::grad(T()))); dimensionedScalar RRRR = average(magSqr(RR)); if (RRRR.value() > VSMALL) { return average(PP & RR)/RRRR; } else { return 1.0; } } 

November 23, 2011, 11:24 

#10 
New Member
Juanito
Join Date: Oct 2010
Posts: 27
Rep Power: 7 
Hi!
I'm working with the buoyantBoussinesqSimpleFoam which employs Laminar and turbulent Prandtl numbers. I would like to know how accurate this approach is and how can I calculate the turbulent prandtl number for different fluids (air and CoO2), because in the literature only the laminar Prandtl number is provided. Thanks a lot!! 

November 23, 2011, 11:54 

#11 
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 14 
The turbulent Prandtl number is not really a property of the fluid, but more a property of the turbulence. Therefor it is (approximately) the same for all fluids (about 0.7 or something like that).


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
DecomposePar unequal number of shared faces  maka  OpenFOAM PreProcessing  6  August 12, 2010 09:01 
BlockMeshmergePatchPairs  hjasak  OpenFOAM Native Meshers: blockMesh  11  August 15, 2008 07:36 
Unaligned accesses on IA64  andre  OpenFOAM  5  June 23, 2008 10:37 
Turbulent Cylinder Strouhal Number  Chetan Kadakia  FLUENT  3  October 10, 2002 03:31 