|
[Sponsors] |
September 22, 2011, 11:27 |
Turbulent Prandtl Number
|
#1 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17 |
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 subgrid-scale 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, 12:54 |
|
#3 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17 |
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, 03:03 |
|
#5 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
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: http://www.cfd-online.com/Forums/ope...agorinsky.html |
|
September 23, 2011, 04:24 |
|
#6 | |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17 |
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, 11:08 |
|
#8 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17 |
||
September 29, 2011, 10:53 |
|
#9 |
Member
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17 |
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: 16 |
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: 22 |
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).
|
|
January 8, 2019, 09:40 |
|
#12 |
New Member
priyesh kakka
Join Date: Jan 2018
Posts: 13
Rep Power: 8 |
[QUOTE=morard;326082]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; } }[/QUOTE} were you able to validate the model correctly? i want to incorporate dynamic eddy diffusive model on lines of dynamic eddy viscosity model(i guess thats what you did) , did you do it for dynamic langrangian model? is there an easier way to implemet it rather than revamping the code to calculate dynamic prandtl numbers? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DecomposePar unequal number of shared faces | maka | OpenFOAM Pre-Processing | 6 | August 12, 2010 10:01 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
Unaligned accesses on IA64 | andre | OpenFOAM | 5 | June 23, 2008 11:37 |
Turbulent Cylinder Strouhal Number | Chetan Kadakia | FLUENT | 3 | October 10, 2002 04:31 |