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

Trying to convert a Supersonic sonicFOAM case made for OFv4 to OFv7?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2020, 05:30
Thumbs up Trying to convert a Supersonic sonicFOAM case made for OFv4 to OFv7?
  #1
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 143
Rep Power: 11
EternalSeekerX is on a distinguished road
Hello,

So currently im adapting a 3D supersonic Case from OpenFOAM 4 to OpenFOAM 7 as sonicFoam was merged with rhoPimpleFOAM (thanks to a user for pointing that out).

So far I have gotten around SurfaceFeatureExtract of stl file, blockMeshing and SnappyHexMeshing. Now the original file was set to use 8 proc, i switched it to 6 procs. Now I edited the controlDict and changed the program to rhoPimpleFoam. I also had to edit the fvSolutions from this

Code:
PIMPLE
{
    nOuterCorrectors 2;
    nCorrectors      1;
    nNonOrthogonalCorrectors 0;
    
}
to this:
Code:
PIMPLE
{
    nOuterCorrectors 2;
    nCorrectors      1;
    nNonOrthogonalCorrectors 0;
    transonic                          yes;
}
I did this based on the naca airfoil case which was originally a sonicFoam case before as well. Is there anything else I would need to change? I also question if I should be using the transonic flag anyway? The initial velocity is set at supersonic speed (Mach 1.7), so it is above the transonic regime.

Is there anything else I need to change per say?

Also after trying to read the all run supplied by the original case:

Code:
#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

application=`getApplication`

runApplication blockMesh
runApplication snappyHexMesh > snappyHexMesh.log
runApplication decomposePar
runApplication echo processor*|xargs -n 1 cp constant
runApplication nohup mpirun -np 8 sonicFoam > log -parallel &

#------------------------------------------------------------------------------
I get most of what it is doing, accept the 2nd last line, what application could it be running? It seems to be copying the 0 folder to all the processor folders?

Thanks for any help you can provide.
EternalSeekerX is offline   Reply With Quote

Old   August 23, 2020, 08:05
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
If you type
Code:
man xargs
it will explain what the xargs command is doing.

Code:
runApplication echo processor*|xargs -n 1 cp constant
I will break it down for you:
- "runApplication" just executes the rest of the line using the OF wrapper, that generates a log file record - very useful
- "echo processor*" lists the names of each of the decomposed folders
- "xargs -n 1" says run xargs, using 1 of the passed parameters (folder names) at a time
- "cp constant" is the command to be processed by xargs, with ofc the parameter on the end
- i.e. this expands to "cp constant <parameter>", with <parameter> replaced first by processor0, then processor 1 etc.

i.e. it is copying constant to each of the decomposed processor folders.
Tobermory is offline   Reply With Quote

Old   August 25, 2020, 05:43
Default
  #3
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 143
Rep Power: 11
EternalSeekerX is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
If you type
Code:
man xargs
it will explain what the xargs command is doing.

Code:
runApplication echo processor*|xargs -n 1 cp constant
I will break it down for you:
- "runApplication" just executes the rest of the line using the OF wrapper, that generates a log file record - very useful
- "echo processor*" lists the names of each of the decomposed folders
- "xargs -n 1" says run xargs, using 1 of the passed parameters (folder names) at a time
- "cp constant" is the command to be processed by xargs, with ofc the parameter on the end
- i.e. this expands to "cp constant <parameter>", with <parameter> replaced first by processor0, then processor 1 etc.

i.e. it is copying constant to each of the decomposed processor folders.
I see. So i can just copy and paste the command "echo processor*|xargs -n 1 cp constant" in the terminal for that step? I ask because I wanna do it step by step instead of using the "allrun" script.

Also do you have any feedback on editing fvschemes and fvsolutions for converting sonicFOAM to rhoPimpleFOAM?
EternalSeekerX is offline   Reply With Quote

Old   August 25, 2020, 06:08
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
Yes - you can do it manually. And as a check, before you commit to running the actual command, you can always preface the command with an "echo" so that it just prints the command, eg

Code:
"echo processor* | xargs -n 1 echo cp constant"
which would then print to the screen

Code:
cp constant processor0
cp constant processor1
.... etc.
As for the fvSolution & fvSchemes contents - I always find that the best place to start is the tutorial examples for each solver. Look at the contents of these for sonicFoam and rhoPimpleFOAM. Best of luck.
Tobermory 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
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 9 August 16, 2015 15:53
Help! Supersonic flow (Library Case 911) PattiMichelle Phoenics 1 May 19, 2009 11:19
looking for a test case, DES, Supersonic flow kaarthik Main CFD Forum 0 June 7, 2007 06:49
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
TO CHAM.HOW I SET UP AN EASY SUPERSONIC CASE? USERPH Phoenics 9 April 3, 2005 16:07


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