|
[Sponsors] |
January 17, 2011, 19:53 |
Different inlet U values steady state
|
#1 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
Hi everyone, I'm a new user of OpenFOAM and I have to make a lot of simulation to validate the use of OF for my case instead of software like Fluent or CFX.
I'm using simpleFoam and I'm looking for an way to make a yaw study. I want to create a file with all the u_x u_y u_z values for yaws from 0 to 20 deg and to ask Of to take these values for the inlet automatically. For example every 2000 timestep, 0deg for 2000 timestep and restart automatically with the 2deg value for an other 2000 timestep ... My other idea is to use "timeVaryingUniformFixedValue" for U : boundaryField { SURFACE_INLET { type timeVaryingUniformFixedValue fileName "FOAM_CASE/U_inlet.timeprof"; outOfBounds clamp; } and to create a file U_inlet.timeprof with ( (0 (3.2294 0 0)) 10 (timestep(u_x u_y u_z)) (2000(x y z)) ) but i don't know of to set a cos/sin dependance for x y and z I hop I'm clear of what I want and you can help me Thanks Alex |
|
January 18, 2011, 11:37 |
|
#2 |
New Member
Alton Luder III
Join Date: Oct 2009
Location: Michigan
Posts: 22
Rep Power: 17 |
Have you thought about setting up a script to run the different cases?
check out pyFoam http://openfoamwiki.net/index.php/Contrib_PyFoam especially pyFoamClearCase.py and pyFoamWriteDictionary.py |
|
January 18, 2011, 16:16 |
what about a bash script?
|
#3 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Although PyFoam is really great, I found it frustrating to learn OpenFoam and PyFoam at the same time. How about just taking an Allrun script (from many of the tutorials) and setting up your cases that are eventually run by your script? A script could look like:
Code:
#!/bin/bash # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions #move into the first case cd case1 printf "starting simplFoam" #print start time date #decompose the mesh assuming you have decomposeParDict correct runApplication decomposePar #parallel run with 8 processes runParallel simpleFoam 8 system/machines #reconstruct the domain runApplication reconstructPar #print the end time and date date #now move to the second case cd ../case2 #repeat first set of commands Dan |
|
January 18, 2011, 18:30 |
|
#4 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
Thanks for your answers, I looked at pyFoam but it's seems hard to get something working in one or two days and i need to set that asap.
Thanks a lot Dan it seems a very good idea, I'm going to try today, I started a Java program with eclipse but get some problems. I'll try to set the Allrun file. Thanks again Alex |
|
January 18, 2011, 18:59 |
|
#5 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
I add some thing in your code Dan tell me if it's good. I usually use the following command to run parallel case :
mpirun -np 6 simpleFoam -parallel > log & I want to know if "runParallel simpleFoam 6 system/machine" will do he same thing Code:
#!/bin/bash # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions #move into the first case cd 4deg printf "starting simplFoam" #print start time date #copy 0 to 0.org cp -r 0 0.org #run potentialFoam runApplication potentialFoam -writep #decompose the mesh assuming you have decomposeParDict correct runApplication decomposePar #parallel run with 8 processes runParallel simpleFoam 6 system/machines #reconstruct the domain runApplication reconstructPar -latestTime #print the end time and date date #now move to the second case cd ../6deg #repeat first set of commands |
|
January 18, 2011, 19:14 |
|
#6 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
yeah the mpirun command is in the runParallel simpleFoam 6 system/machines command. The machines file in the system folder must be there and that contains the hostname of the computer (it doesn't need the number of processors for this command).
|
|
January 18, 2011, 19:22 |
|
#7 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
I don't have a machine file in my system folder. Can you give a copy of this file ?
Thanks |
|
January 18, 2011, 19:33 |
|
#8 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
go to the terminal and type
hostname > machines then put that file in your system folders |
|
January 18, 2011, 19:43 |
|
#9 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
Ok thanks a lot for everything. Hope it will be ok
|
|
January 19, 2011, 19:12 |
|
#10 | |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
Hi, I try to launch it this morning and I got this error message :
Quote:
|
||
January 19, 2011, 19:40 |
|
#11 | |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Quote:
if you type echo $WM_PROJECT_DIR then something like /home/dcombest/OpenFOAM/OpenFOAM-1.6-ext should come up. if not then something is wrong with your install. Dan |
||
January 19, 2011, 19:58 |
|
#12 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
I got :
/home/arubel/OpenFOAM/OpenFOAM-1.6 |
|
January 19, 2011, 20:30 |
|
#13 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
does /home/arubel/OpenFOAM/OpenFOAM-1.6/bin/tools/RunFuntions exist?
are you calling the script correctly? If you call it from the directory where is exists then call it by Code:
./ScriptName Code:
sh ScriptName.sh echo $SHELL should give you /bin/bash It should work if all is set up correctly. Paste the whole script if you want me to try. |
|
January 19, 2011, 20:37 |
|
#14 | ||
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
I'm using ubuntu so it's a bash shell. And The RunFunctions files exist in the /home/arubel/OpenFOAM/OpenFOAM-1.6/bin/tools/
I don't really understans what i have to do with Code:
./ScriptName Quote:
Quote:
|
|||
January 19, 2011, 20:56 |
|
#15 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
sorry...the ./ScriptName is actually ./Allrun I just wasnt sure what you called your script. I will try this tomorrow morning....Im out of the office.
|
|
January 19, 2011, 22:50 |
|
#16 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
I tried your script and it worked where it was suppose to work. I'm not sure what the issue is on your system.
|
|
January 19, 2011, 23:01 |
|
#17 |
New Member
Alexandre Rubel
Join Date: Dec 2010
Location: Launceston, Tasmania AUSTRALIA
Posts: 28
Rep Power: 16 |
Could it be a problem of authorisation because I always have to use sudo to source something ...
|
|
January 19, 2011, 23:27 |
|
#18 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
That might be the problem. My install is in my home directory.
|
|
Tags |
automatically, change, inlet, simplefoam, speed |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Arithmetic mean of velocity (steady - state) | lentschi | CFX | 3 | January 11, 2011 07:18 |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 09:56 |
About the difference between steady and unsteady problems | Lisa | Main CFD Forum | 11 | July 5, 2000 15:37 |
Steady state formulation of turbulence ?? | Jitendra | Main CFD Forum | 1 | June 27, 2000 19:49 |