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

Compressible fluid at high velocity in Muti-region solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2015, 05:47
Question Compressible fluid at high velocity in Muti-region solver
  #1
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
I am working on a project dealing with a gas at high speed surrounded with a solid and a liquid. I tried chtMultiRegionsolver but it does not work. All the tutorials I have seen with multiregion have either only incompressibleliquids OR compressible liquids with negligible speed (mainly convective currents)
Does someone know which solver can be used for Multi-region compressible flows with high speed.
Also is it possible to use that solver in parallel servers for quick calculation as the mesh size is quite big.
Thanks,
Vineet
vineet_bhola is offline   Reply With Quote

Old   August 24, 2015, 06:56
Default
  #2
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 28
Rep Power: 12
LukaD is on a distinguished road
It is perfectly possible to obtain good results for high-speed flows from chtMultiRegionFoam. The only thing you should be aware of is that viscous heating terms are neglected in the energy equation. Therefore, you should either check if these terms matter or implement them yourself and recompile the solver. I did this myself for my own work, you can find the custom solver attached. I also removed the buoyancy calculation because it was not necessary for my application. Please be careful, this work has not been validated!

As for parallelization, this is also possible. It will probably be necessary to parallelize the fluid domain as this is most computationally intensive. Use
Code:
decomposePar -region fluid
to do this.
LukaD is offline   Reply With Quote

Old   August 24, 2015, 09:27
Default
  #3
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
Hi Luka,
Thanks a lot for your reply. I am using exhaust gas and cooling water as the two fluid mediums for my problem(encased in aluminium body). There would be definately heat transfer between these volumes but I am not sure if I could ignore viscous heating(maybe for gas but not sure of water).
I am not able to view your attachment. Can you please try again. Maybe you have to compress your case scripts. I think the maximum size is 97 kB.
Thanks,
Vineet
vineet_bhola is offline   Reply With Quote

Old   August 24, 2015, 09:46
Default
  #4
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 28
Rep Power: 12
LukaD is on a distinguished road
Hi there,

You are right, the attachment was too big because I also tried to include the compiled executable. Attached you can find the code. Keep in mind that this is the steady-state version, if you want to have a transient version you should modify the code of that solver accordingly.

Good luck.
Attached Files
File Type: zip myChtSimpleFoam.zip (14.3 KB, 21 views)
LukaD is offline   Reply With Quote

Old   August 24, 2015, 10:22
Thumbs up
  #5
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
awesome...thanks a lot..I would have never imagined creating my own custom solver. and that's why there is one more doubt. How do I incorporate all these .C and .H scripts into my case directory. I am guessing, I should add these to the system folder accordng to regions. and in my .sh script use "mychtSimpleFoam" instead of the default chtMultiRegion solver.
Thanks
Vineet
vineet_bhola is offline   Reply With Quote

Old   August 24, 2015, 10:34
Default
  #6
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 28
Rep Power: 12
LukaD is on a distinguished road
Hi Vineet,

If you google "Compile OpenFOAM solver" you will find lots of material on this topic. In this pdf you can find a guide, for example.

Then you should indeed run myChtSimpleFoam instead of the current solver.

Luka
LukaD is offline   Reply With Quote

Old   August 25, 2015, 09:07
Default
  #7
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
cool..thanks once again Luka. From what I have understood, the underlying basis is how we define velocity, energy and pressure field equations.
As I am from Automotive background, I am having hard time understanding fluid dynamics and thermodynamics equations. Do you have any links where I can find an overview of these equations. I found Navier-Stokes equation but it does not have any mention of energy equation. Before I make any changes into these equations, I need some theoretcal background
Apart from that, where can I find some description about functions like "turb.alphaEff()", "turb.divDevRhoReff(U)" etc. OR in general formats and keywords used in solver files
Thanks
Vineet
vineet_bhola is offline   Reply With Quote

Old   August 26, 2015, 04:52
Default
  #8
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 28
Rep Power: 12
LukaD is on a distinguished road
Hi Vineet,

For background on the equations, you really need to get a good book. There are several listed on this website. For an introduction into fluid dynamics, I would personally recommend "Fundamentals of Aerodynamics" by Anderson, even though it is not a CFD book.

As for what turb.alphaEff and turb.divDevRhoReff mean, I would counsel you to look through the OpenFOAM source code - you can also use the documentation on http://foam.sourceforge.net/docs/cpp/

But maybe the first step is to do some simulations with chtMultiRegionFoam or chtMultiRegionSimpleFoam without changing the equations. That way you can at least get an idea whether the code will work for you. After you've gained some confidence with OpenFOAM you can then proceed to changing the equations if needed.
LukaD is offline   Reply With Quote

Old   September 17, 2015, 06:02
Default
  #9
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
Hi Luka
I was occupied with some meshing error and could not get time to actually test the solver. I tried yesterday and got some error. Can you please let me know if I am using Parameters or values wrong?
I tried copying the data from Tutorials "MultiRegionLiquidheater". But that was concentrated mainly with laminar flow and I have used Turbulence RAS model so I am not sure about some values especially k and Epsilon.

I hope the attachments give you some idea about problem Scenario. The Situation is so that hot air flows through a cylinder encased in Aluminium Body which has a cooling water flowing through it. (STL were big to be attached...so I compressed them seperately ...solid.rar, wasserwall.rar...solid_wasser_abgas.rar is the case file without any stl surfaces )
Attached Images
File Type: png cfd_summary2.png (36.4 KB, 19 views)
Attached Files
File Type: zip solid_wasser_abgas.zip (53.0 KB, 4 views)
File Type: zip triSurface.zip (11.5 KB, 2 views)
File Type: zip solid.zip (56.4 KB, 5 views)
File Type: zip wasserwall.zip (44.3 KB, 2 views)
vineet_bhola is offline   Reply With Quote

Old   September 17, 2015, 06:11
Default
  #10
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
I forgot to add the log file with error...I could not figure out which Parameter had exactly caused the error

EDIT: Please find the updated runscript attached(i had to convert it to .doc file for compatibility)
Attached Files
File Type: doc 12_log_cht.doc (60.2 KB, 5 views)
File Type: doc runscript_grid.sh.doc (2.9 KB, 7 views)

Last edited by vineet_bhola; September 17, 2015 at 06:57. Reason: updated runscript.sh
vineet_bhola is offline   Reply With Quote

Old   September 17, 2015, 06:23
Default
  #11
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 28
Rep Power: 12
LukaD is on a distinguished road
Hi Vineet,

I am unable to unzip the file you uploaded, but the log indicates there is an error when constructing the turbulence model. Make sure you do not initialize with zero k and epsilon on the internal field, give a reasonable initial value.

Otherwise first try the laminar case to make sure the solver is working, then go on to the turbulence model. I've found that trial and error is often necessary to get to know new parts of OpenFOAM.
LukaD is offline   Reply With Quote

Old   September 17, 2015, 07:03
Default
  #12
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
Thanks for your reply. Can you please give me a rule of thumb , how to select values of k and Epsilon? Meanwhile I try it with Laminar flow for checking the solver. Btw, what happens if the velocity is too high to be laminar flow and the solver tries to define it to be laminar?

Regarding the files. These were actually a .rar file but that Format was not compatible so I edited it to .zip file. Can you please try to rename it back to .rar and then uncompress.
vineet_bhola is offline   Reply With Quote

Old   September 17, 2015, 07:12
Default
  #13
New Member
 
Join Date: Aug 2015
Posts: 17
Rep Power: 11
user10600 is on a distinguished road
Hi,


to compute k and epsilon values, here is a useful link :
http://www.cfd-online.com/Wiki/Turbu...ary_conditions

Regards,

David.
user10600 is offline   Reply With Quote

Old   September 17, 2015, 10:33
Default
  #14
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
Thanks alot David. That was really helpful
vineet_bhola is offline   Reply With Quote

Old   October 26, 2015, 06:04
Default
  #15
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
I have given some Initial non Zero values to k and Epsilon. But when I define my gaseous Region as compressible or to be precise,
Code:
hRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
chtMultiRegionSimpleFoam gives an error which I am not able to understand.
Please refer to the attached logfile.

Although with the same initial and boundary conditions, If I change the ThermophysicalProperties to be incompressible ,
Code:
hRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<incompressible>>>>>
it runs fine.

here is a part of the log file with incompressible properties. It was a really big file ~20 MB so I have taken the logfile only till the first Iteration
Quote:
Create time

Create fluid mesh for region abgas for time = 0

Create fluid mesh for region wasser for time = 0

Create solid mesh for region kopf for time = 0

*** Reading fluid mesh thermophysical properties for region abgas

Adding to thermoFluid

Selecting thermodynamics package hRhoThermo<pureMixture<constTransport<specieThermo <hConstThermo<incompressible>>>>>
Adding to rhoFluid

Adding to KFluid

Adding to UFluid

Adding to phiFluid

Adding to gFluid

Adding to turbulence

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
sigmak 1;
sigmaEps 1.3;
Prt 1;
}

Adding to ghFluid

Adding to ghfFluid

Selecting radiationModel none
*** Reading fluid mesh thermophysical properties for region wasser

Adding to thermoFluid

Selecting thermodynamics package hRhoThermo<pureMixture<constTransport<specieThermo <hConstThermo<incompressible>>>>>
Adding to rhoFluid

Adding to KFluid

Adding to UFluid

Adding to phiFluid

Adding to gFluid

Adding to turbulence

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
sigmak 1;
sigmaEps 1.3;
Prt 1;
}

Adding to ghFluid

Adding to ghfFluid

Selecting radiationModel none
*** Reading solid mesh thermophysical properties for region kopf

Adding to thermos

Constructed constSolidThermo with
rho : rho [1 -3 0 0 0 0 0] 2700
Cp : Cp [0 2 -2 -1 0 0 0] 1160
K : K [1 1 -3 -1 0 0 0] 200
Hf : Hf [0 2 -2 0 0 0 0] 0
emissivity : emissivity [0 0 0 0 0 0 0] 0
kappa : kappa [0 -1 0 0 0 0 0] 0
sigmaS : sigmaS [0 -1 0 0 0 0 0] 0

Time = 1


Solving for fluid region abgas
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.02348612, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 0.01860567, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 0.008489814, No Iterations 1
DILUPBiCG: Solving for h, Initial residual = 1, Final residual = 0.01319835, No Iterations 1
Min/max T:800.0236 1247.3
GAMG: Solving for p_rgh, Initial residual = 0.9999939, Final residual = 0.006830426, No Iterations 11
time step continuity errors : sum local = 7.336919, global = -0.1074577, cumulative = -0.1074577
Min/max rho:0.7 0.7
DILUPBiCG: Solving for epsilon, Initial residual = 0.1393761, Final residual = 0.002278375, No Iterations 2
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 0.02064519, No Iterations 2

Solving for fluid region wasser
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.02964463, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 0.02533394, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 0.03579749, No Iterations 1
DILUPBiCG: Solving for h, Initial residual = 1, Final residual = 0.02474972, No Iterations 1
Min/max T:363.15 799.7066
GAMG: Solving for p_rgh, Initial residual = 0.9872267, Final residual = 0.007051082, No Iterations 3
time step continuity errors : sum local = 8885.723, global = -5147.09, cumulative = -5147.197
Min/max rho:1030.98 1030.98
DILUPBiCG: Solving for epsilon, Initial residual = 0.9995245, Final residual = 0.02359116, No Iterations 2
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 0.001944546, No Iterations 1

Solving for solid region kopf
DICPCG: Solving for T, Initial residual = 1, Final residual = 0.0363293, No Iterations 2
Min/max T:767.9964 801.6727
ExecutionTime = 28.16 s ClockTime = 29 s

Attached Files
File Type: doc log_cht_compressible.doc (55.9 KB, 3 views)
vineet_bhola is offline   Reply With Quote

Old   October 26, 2015, 06:36
Default
  #16
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 28
Rep Power: 12
LukaD is on a distinguished road
Hi Vineet,

I'm not sure, but it could be that your k or epsilon fields are initialized to 0. Make sure that at least one of the boundaries or the internal field has a non-zero value for both k and epsilon at the first iteration.

Luka
LukaD is offline   Reply With Quote

Old   October 26, 2015, 06:54
Default
  #17
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 11
vineet_bhola is on a distinguished road
But I have given k and Epsilon non-Zero values for all the patches.I have attached the Initial and boundary conditions' file.
Infact the same conditions worked fine for incompressible flow. That is my biggest confusion. check out my comment above.
Infact i even tried compressible fluid with laminar flow and that failed too. Check out the log file attached

Vineet
Attached Files
File Type: doc k.doc (1.7 KB, 2 views)
File Type: doc epsilon.doc (1.7 KB, 0 views)
File Type: doc 12_log.cht_laminar_compressible.doc (16.5 KB, 5 views)
vineet_bhola is offline   Reply With Quote

Reply

Tags
compressible flow, high air velocity, multiregion


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
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
Solver for compressible two fluid mixing with heat transfer inf.vish OpenFOAM Running, Solving & CFD 4 July 31, 2013 10:39
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM 0 April 4, 2010 19:06
interfacing a fluid solver with abaqus Tuhin Rakshit Main CFD Forum 0 June 16, 2005 11:03


All times are GMT -4. The time now is 08:31.