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

quick way to change from incompressible to compressible?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By swahono

Reply
 
LinkBack Thread Tools Display Modes
Old   April 1, 2012, 14:56
Default quick way to change from incompressible to compressible?
  #1
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
assuming I am all set up for incompressible flow using simpleFOAM, what do I need to change to perform compressible analysis on the same geometry with minimal fuss?
which tutorial should I look at?
thanks!
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 1, 2012, 19:29
Default
  #2
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
I should state that I'm looking mainly at external flows right now with Aerospace applications.
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 1, 2012, 21:35
Default
  #3
Member
 
Stefano Wahono
Join Date: Aug 2010
Location: Melbourne, Australia
Posts: 42
Rep Power: 6
swahono is on a distinguished road
Hi Mihai,

You can use rhoSimpleFoam for the steady compressible solver, or rhoPimpleFoam for the unsteady counterpart.

I assume your question was "how to restart your incompressible simulation using a compressible solver"?

The problem with the above scenario is the different dimension of the phi between the incompressible and compressible cases.
The incompressible solver uses a volumetric form of phi (normalised by rho), while the compressible solver uses the mass flux form for phi.

What you can do is convert your incompressible phi (volumetric flux) to the compressible phi (mass flux) using the attached utility.
The utility will writes out two new fields into your time directories, i.e. rhophi and rhop.
You can then clone your case into a new case, and rename the rhophi to phi, and rhop to p.
If you are using turbulence model, then you need to extend the attached utility to also convert the nu to mu. The method is exactly the same as the p conversion.

You need to create your own Make/files and Make/options.

Code:
$ cat Make/files
 
convertPhi.C
EXE = $(FOAM_USER_APPBIN)/convertPhi
Code:
$ cat Make/options
 
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
 
EXE_LIBS = \
-lfiniteVolume

Good Luck,

Stefano
Attached Files
File Type: c convertPhi.C (4.2 KB, 65 views)
namsivag likes this.
__________________
Stefano Wahono

Defence Science and Technology Organisation
Propulsion Systems
swahono is offline   Reply With Quote

Old   April 4, 2012, 12:56
Default
  #4
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
thanks. I think I'll start from scratch instead.
is sonicFoam a good solver for external compressible flows?
Assuming I followed the motorcycle tutorial to set up an imcompressible flow case of my own, can I reuse the mesh dicts for SHM and BM, and, from the NACA Airfoil tutorial, adapt the controldict,fvsolution and fvscheme, add the new variables in the time 0 folder with the files alphat etc, and the RAS, thermo and turb files from the constant folder?
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 4, 2012, 21:31
Default
  #5
Member
 
Stefano Wahono
Join Date: Aug 2010
Location: Melbourne, Australia
Posts: 42
Rep Power: 6
swahono is on a distinguished road
> is sonicFoam a good solver for external compressible flows?

Depends. If you want low subsonic then NO.
If you need steady solver, then NO.
If you need to solve high Mach (transonic to supersonic) and unsteady, then YES.
If you need steady compressible solver (from low subsonic to transonic) then use rhoSimpleFoam.
If you need unsteady solver (from low subsonic to transonic), use rhoPimpleFoam.
***remember to enable/disable the transonic setting in rhoSimpleFoam and rhoPimpleFoam.

> Assuming I followed the motorcycle tutorial to set up an imcompressible
> flow case of my own, can I reuse the mesh dicts for SHM and BM, and,
> from the NACA Airfoil tutorial, adapt the controldict,fvsolution and
> fvscheme, add the new variables in the time 0 folder with the files alphat
> etc, and the RAS, thermo and turb files from the constant folder?

What is SHM and BM?
You can transfer mesh between cases by just copying the constant/polyMesh directory.

Yes, you can adapt the controlDict, fvSolution and fvSchemes files from the tutorials.
The settings in the tutorials (i.e. fvSchemes and fvSolution) are NOT optimal for complex flow and bad mesh.

You need BCs in 0:
U, p, T, mut, alphat, k, epsilon, or omega.
Solver will calculate and write phi during runtime.

You can copy RASModel, turbulenceModel and thermophysicalPorperties from the tutorial.
Change them to suit what you are trying to model.

Best regards,
Stefano
__________________
Stefano Wahono

Defence Science and Technology Organisation
Propulsion Systems
swahono is offline   Reply With Quote

Old   April 4, 2012, 21:38
Default
  #6
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 190
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
thanks Stefano. i think i will use rhoSimpleFoam.
SHM is snappyhexmesh and BM is blockmesh
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incompressible Compressible coupling... dog5011 Main CFD Forum 4 June 19, 2009 03:50
Using compressible BCs for incompressible problems cfd Main CFD Forum 1 April 16, 2006 02:41
Compressible or Incompressible? Samy CFX 5 November 18, 2004 13:16
Compressible vs. Incompressible formulations Fernando Velasco Hurtado Main CFD Forum 3 January 7, 2000 17:51
Compressible vs. incompressible NS at high Temperatures Jean Lacroix Main CFD Forum 1 December 24, 1999 07:21


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