CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   solver for subsonic compressible turbulent flow in OF 1.7 (http://www.cfd-online.com/Forums/openfoam-solving/79323-solver-subsonic-compressible-turbulent-flow-1-7-a.html)

nileshjrane August 19, 2010 14:35

solver for subsonic compressible turbulent flow in OF 1.7
 
Hi all,

I want to solve a susonic, turbulent compressible flow in OF 1.7. Which solver should i use??? Please help..its argent

alberto August 20, 2010 02:13

Depending upon the case (steady/unsteady), take a look at:

  • rhoSimpleFoam (steady)
  • rhoPisoFoam / rhoPimpleFoam (unsteady / pseudo-transient)
Best,

nileshjrane August 20, 2010 03:17

Thank you Alberto for the reply.

My doubt it can i use these solvers for the flow which has Mach numbers upto 1..??? Are the pressure based solvers able to handle higher subsonic mach numbers???

alberto August 20, 2010 03:24

You asked about subsonic flows. Not highly supersonic. :-)

There are other solvers able to do that (see rhoCentralFoam and the various "sonic" solvers).

Best,

nileshjrane August 20, 2010 08:01

With all due respect Sir, i said "highly subsonic" means mach number arnd 0.8 or 0.9. Sorry if my statement was ambiguous.

Thanks for your quick replies. One more question, my friend suggested me that "rhoturbFoam" is the best choice for my problem but its not there in OF 1.7.. So what is the difference between "rhoturbForm" and say "rhosonicForm"??

alberto August 20, 2010 10:31

Quote:

Originally Posted by nileshjrane (Post 272161)
With all due respect Sir, i said "highly subsonic" means mach number arnd 0.8 or 0.9. Sorry if my statement was ambiguous.

I'm really sorry: I misread. Result of answering late in the evening ;-)

Quote:

Thanks for your quick replies. One more question, my friend suggested me that "rhoTurbFoam" is the best choice for my problem but its not there in OF 1.7.. So what is the difference between "rhoturbForm" and say "rhosonicForm"??
rhoTurbFoam was a RANS solver in OpenFOAM 1.5, and was merged in rhoPisoFoam in OpenFOAM 1.6 and 1.7, with RANS and LES capabilities.

rhoSonicFoam is a density-based inviscid solver.

About your original question, yes, in theory pressure-based solver should work with those values of Mach number (See for example Peric's papers and book on the topic).

Best,

nileshjrane August 20, 2010 14:20

Thank you very much Sir.

Your lucid answer really helped me a lot. This lack of documentation thing really makes it a difficult task for a newbie like me to get going with OF.

alberto August 20, 2010 15:04

You are welcome. If you need further help, please don't hesitate to ask. The forum is a often a quick way to get answers.

Best,

nileshjrane August 22, 2010 07:58

Hello Alberto Sir,

As you have suggested, i am using rhopisoFoam for my problem. :)

Brief description of my problem:

Its cold flow simulation of mixing in a secondary combustor of a rocket motor. In this air and fuel streams are getting mixed together. I am planning to use RNGkepsilon model for this using rhoPisoFoam.

BCs:

Air inlet: Mach 0.3, stgT = 840K, staticT = 825K, Vin = 172m/s, massflow = 5.19kg/s, k and eps can be calculated using formulae

Fuel Inlet : Mach = 1, staticT = 650 >>Vin 244m/s, massflow = 0.2581kg/s, k and eps can be calculated using formulae

Wall: Adiabetic

Outlet: there is a chocked nozzle at the end of combustor which i am not simulating, but from chocked condition the pressure at the inlet of nozzle can be calculated as 7.2 bar.


I saw the tut for rhoPisoFoam. It uses SST kw model..but the "0" directory contains files for alphat, p, t, u, k, eps, omega, R. I got why we need u,p,t,k,omega. but why other files are present? I know what eps is, alphat is probably diffusivity but i dont know what is R.

Also i am confused that, out of the known BC parameters which should be specified???
Also i found out some of the BCs as:

Code:

 
 movingWall
    {
        type            compressible::kqRWallFunction;
        value          uniform 0.00325;
    }

what are these types??


Can you give me any direction???

alberto August 22, 2010 14:10

Quote:

Originally Posted by nileshjrane (Post 272268)
Hello Alberto Sir,



Just Alberto ;)

Quote:

I saw the tut for rhoPisoFoam. It uses SST kw model..but the "0" directory contains files for alphat, p, t, u, k, eps, omega, R. I got why we need u,p,t,k,omega. but why other files are present? I know what eps is, alphat is probably diffusivity but i dont know what is R.
R is the Reynolds stress tensor.

alphat is the turbulent thermal diffusivity, and it is used essentially in wall-functions.

Quote:

Also i found out some of the BCs as:

Code:

 
 movingWall
    {
        type            compressible::kqRWallFunction;
        value          uniform 0.00325;
    }

what are these types??

Can you give me any direction???
The 'type' keyword specifies the type of the BC you are setting. You find a summary in section 5.2 of the user guide, while wall functions are briefly discussed in section 7.2.2.

Best,

nileshjrane August 22, 2010 15:05

Alberto,

Thanks for the reply.:)

What i am confused about is, do i really need to specify the values for omega, mut, alphat and R??? if yes how should i obtain them based on the BCs i have??? :confused:

I know the formula for calculating omega. but not for the others...:(

A thought:

Is it like, the variables we need to depend are based on the turbulence model we use?? like for k-eps we need k, eps...for k-w we need k and omega, for RSM mode we would need k, and R..and alphat in case of heat transfer is needed to be calculated????

alberto August 22, 2010 15:16

Quote:

Originally Posted by nileshjrane (Post 272288)
What i am confused about is, do i really need to specify the values for omega, mut, alphat and R??? if yes how should i obtain them based on the BCs i have??? :confused:

You said you want to use the RNG k-epsilon model, as a consequence omega and R are not required. You need omega if you use for example k-omega, and you need R if you use Reynolds stress models.

You should have mut and alphat, which are specified using wall-functions at walls, and are calculated elsewhere. Take a look at this tutorial

/OpenFOAM-1.7.x/tutorials/compressible/rhoPimpleFoam/angledDuct/0/

It is for rhoPimpleFoam, however the only difference is in the iterative procedure. There you can see how alphat and mut are set up.

Quote:

Is it like, the variables we need to depend are based on the turbulence model we use?? like for k-eps we need k, eps...for k-w we need k and omega, for RSM mode we would need k, and R..and alphat in case of heat transfer is needed to be calculated????
Correct. However the energy equation is always solved in compressible codes, as consequence you need alphat :-)

Best,

nileshjrane August 22, 2010 15:40

Thanks..that makes the things more clear now.

Actually i have worked on a k-eps research code for long time, and there such parameters as alpha or mut would be calculated internally, so i never had to specify them externally. So it didnt occur to me quickly..:(

But thank you very much for the quick replies.:D

I have one more doubt if i may trouble some more..

I need to have info on mixing, which means air/fuel mixture fraction distribution which obviously not gonna be there in rhoPisoFoam. So how to get this data?? One approach i could think of is to define a scaler which will have value 1 for fuel and 0 for air and thus can give the mixture fraction straightaway. But i think i will need to solve transport equation for that. Is there any better way?? If not how to do this scalar thing???

alberto August 22, 2010 15:45

Quote:

Originally Posted by nileshjrane (Post 272293)
Thanks..that makes the things more clear now.

Actually i have worked on a k-eps research code for long time, and there such parameters as alpha or mut would be calculated internally, so i never had to specify them externally. So it didnt occur to me quickly..:(

They are still calculated internally, but you can choose how in OpenFOAM ;-)


Quote:

I need to have info on mixing, which means air/fuel mixture fraction distribution which obviously not gonna be there in rhoPisoFoam. So how to get this data?? One approach i could think of is to define a scaler which will have value 1 for fuel and 0 for air and thus can give the mixture fraction straightaway. But i think i will need to solve transport equation for that. Is there any better way?? If not how to do this scalar thing???
Depending on you needs you can add the scalar transport equation, or use one of the solvers which include species transport (reacting/diesel solvers), which are more flexible and can use chemical databases (chemkin).

Best,

nileshjrane August 22, 2010 15:59

Quote:

Depending on you needs you can add the scalar transport equation, or use one of the solvers which include species transport (reacting/diesel solvers), which are more flexible and can use chemical databases (chemkin).
Thanks, that would be all for now. i am setting up case for rhopisoFoam now.:o

nileshjrane August 24, 2010 06:47

Hello Alberto, :)

I am facing this error for rhoPisoFoam. Do you know what it means???

Quote:

Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>>
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam170/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/opt/openfoam170/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 Foam::hPsiThermo<Foam::pureMixture<Foam::constTran sport<Foam::specieThermo<Foam::hConstThermo<Foam:: perfectGas> > > > >::calculate() in "/opt/openfoam170/lib/linux64GccDPOpt/libbasicThermophysicalModels.so"
#4 Foam::hPsiThermo<Foam::pureMixture<Foam::constTran sport<Foam::specieThermo<Foam::hConstThermo<Foam:: perfectGas> > > > >::hPsiThermo(Foam::fvMesh const&) in "/opt/openfoam170/lib/linux64GccDPOpt/libbasicThermophysicalModels.so"
#5 Foam::basicPsiThermo::addfvMeshConstructorToTable< Foam::hPsiThermo<Foam::pureMixture<Foam::constTran sport<Foam::specieThermo<Foam::hConstThermo<Foam:: perfectGas> > > > > >::New(Foam::fvMesh const&) in "/opt/openfoam170/lib/linux64GccDPOpt/libbasicThermophysicalModels.so"
#6 Foam::basicPsiThermo::New(Foam::fvMesh const&) in "/opt/openfoam170/lib/linux64GccDPOpt/libbasicThermophysicalModels.so"
#7
in "/opt/openfoam170/applications/bin/linux64GccDPOpt/rhoPisoFoam"
#8 __libc_start_main in "/lib/libc.so.6"
#9
in "/opt/openfoam170/applications/bin/linux64GccDPOpt/rhoPisoFoam"
Floating point exception

Thank you.

alberto August 24, 2010 10:08

Quote:

Originally Posted by nileshjrane (Post 272490)
Hello Alberto, :)

I am facing this error for rhoPisoFoam. Do you know what it means???

Let me grab my crystal ball :D

It means that there is some problem in your setup. Compare with a tutorial case, and start changing it step by step to adapt it to your case.

Best,

nileshjrane August 31, 2010 05:43

1 Attachment(s)
Hi,

I somehow managed to make the solver run. But now i am facing one more problem.

The Co number keeps increasing to large numbers. I cannot make the mesh more coarser and the Co problem makes the time step so small that the simulation will take thousand years to complete..:eek: (Thank god i have i7 processor;))

Now i am using the default solver settings of rhoPisoFoam from the tut of OF1.7. I want to know how can i tackle this Co problem without changing mesh and timestep, but modifying say relaxation factors and scheme only??? For this which scheme can be better or which UR factors can be good. (This is part of experience which i dont have much. :( so asking here).

Any suggestions???

PFA my case files.

Chris Lucas August 31, 2010 06:55

Hi,

set "adjustTimeStep" to yes and perhaps start with smaller delta T

Regards,
Christian

nileshjrane August 31, 2010 07:06

Hi chris,

I have tried that. It does not help.

My friend just told me that rhoPisoFoam does not solve 'rho' equation and thats why probably is problematic. He suggested me to use 'rhoSonicFoam' and see what happens.

Also i read somewhere on forum that rhopimpleFoam is stable for Co>1 as well. is that right?? Does that mean its an implicit solver???

BTW i have one more doubt, how would i know which solver is implicit and which is explicit?? Where to look for this ans and what to look for??

Thank you for the replies..:)





All times are GMT -4. The time now is 20:30.