# quick way to change from incompressible to compressible?

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 April 1, 2012, 14:56 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: 8 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

 April 1, 2012, 19:29 #2 Senior Member   Mihai Pruna Join Date: Apr 2010 Location: Boston Posts: 190 Blog Entries: 1 Rep Power: 8 I should state that I'm looking mainly at external flows right now with Aerospace applications. __________________ Mihai Pruna's Bio

April 1, 2012, 21:35
#3
Member

Stefano Wahono
Join Date: Aug 2010
Location: Melbourne, Australia
Posts: 42
Rep Power: 8
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
 convertPhi.C (4.2 KB, 105 views)
__________________
Stefano Wahono

Defence Science and Technology Organisation
Propulsion Systems

 April 4, 2012, 12:56 #4 Senior Member   Mihai Pruna Join Date: Apr 2010 Location: Boston Posts: 190 Blog Entries: 1 Rep Power: 8 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

 April 4, 2012, 21:31 #5 Member   Stefano Wahono Join Date: Aug 2010 Location: Melbourne, Australia Posts: 42 Rep Power: 8 > 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

 April 4, 2012, 21:38 #6 Senior Member   Mihai Pruna Join Date: Apr 2010 Location: Boston Posts: 190 Blog Entries: 1 Rep Power: 8 thanks Stefano. i think i will use rhoSimpleFoam. SHM is snappyhexmesh and BM is blockmesh __________________ Mihai Pruna's Bio

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post dog5011 Main CFD Forum 4 June 19, 2009 03:50 cfd Main CFD Forum 1 April 16, 2006 02:41 Samy CFX 5 November 18, 2004 13:16 Fernando Velasco Hurtado Main CFD Forum 3 January 7, 2000 17:51 Jean Lacroix Main CFD Forum 1 December 24, 1999 07:21

All times are GMT -4. The time now is 21:58.

 Contact Us - CFD Online - Top