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

Turbulent Prandtl Number

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2011, 11:27
Default Turbulent Prandtl Number
  #1
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
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
morard is offline   Reply With Quote

Old   September 22, 2011, 12:16
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
it seems you write correctly
1)did you compile ur new modified solver?
2) did you add T into ur 0 directory?
3) whats the error?
nimasam is offline   Reply With Quote

Old   September 22, 2011, 12:54
Default
  #3
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
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?
morard is offline   Reply With Quote

Old   September 22, 2011, 19:54
Default
  #4
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
search for lookup object
nimasam is offline   Reply With Quote

Old   September 23, 2011, 03:03
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
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
Bernhard is offline   Reply With Quote

Old   September 23, 2011, 04:24
Default
  #6
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
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
Thanks Bernhard.

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,
morard is offline   Reply With Quote

Old   September 23, 2011, 06:07
Default
  #7
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
you can read T easily with this syntax :
const volScalarField& T =
db().lookupObject<volScalarField>("T");
nimasam is offline   Reply With Quote

Old   September 23, 2011, 11:08
Default
  #8
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
Quote:
Originally Posted by nimasam View Post
you can read T easily with this syntax :
const volScalarField& T =
db().lookupObject<volScalarField>("T");
Thanks, I'll also try on that way.
morard is offline   Reply With Quote

Old   September 29, 2011, 10:53
Default
  #9
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
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;
}
}
morard is offline   Reply With Quote

Old   November 23, 2011, 11:24
Default
  #10
New Member
 
Juanito
Join Date: Oct 2010
Posts: 27
Rep Power: 16
Aerospace is on a distinguished road
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!!
Aerospace is offline   Reply With Quote

Old   November 23, 2011, 11:54
Default
  #11
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
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).
Bernhard is offline   Reply With Quote

Old   January 8, 2019, 09:40
Default
  #12
New Member
 
priyesh kakka
Join Date: Jan 2018
Posts: 13
Rep Power: 8
kakkapriyesh is on a distinguished road
[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?
kakkapriyesh is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 17:54.