Different inlet U values steady state
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 |
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 |
what about a bash script?
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:
Dan |
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 |
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 |
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).
|
I don't have a machine file in my system folder. Can you give a copy of this file ?
Thanks |
go to the terminal and type
hostname > machines then put that file in your system folders |
Ok thanks a lot for everything. Hope it will be ok
|
Hi, I try to launch it this morning and I got this error message :
Quote:
|
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 |
I got :
/home/arubel/OpenFOAM/OpenFOAM-1.6 |
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. |
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:
|
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.
|
I tried your script and it worked where it was suppose to work. I'm not sure what the issue is on your system.
|
Could it be a problem of authorisation because I always have to use sudo to source something ...
|
That might be the problem. My install is in my home directory.
|
All times are GMT -4. The time now is 14:57. |