|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 11 ![]() |
Hi All,
I just would like to use Dakota to run multiple cases by changing the input boundary condition of the velocity using include folder in the 0 directory. For instance, 0/include/Velocity. Inside the velocity file, I put the following; Code:
v0 10; //m/s Thanks, |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
|
Hi, if your goal is only to see how your system changes according to your velocity parameter. You can skip dakota and simply by using bash script to clone your case and with sed command, you can change that parameter.
If your goal is to analyze which is the best value for V compared to a desired p value , for example,, ok, i can't be of help, but Dakota can manage these studies Sent from my ASUS_X008D using CFD Online Forum mobile app |
|
|
|
|
|
|
|
|
#3 |
|
Member
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 11 ![]() |
Hi,
Thank you for your kind reply. My goal is just to run different simulations using different velocity and store them in one text file not more than that. It would be really great if you can help me out create this script. Thanks in advance, |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
|
Hi,
I think your able to manage it by your self; indeed I'm not a skilled programmer; I'm able to understand what a program does (not too much). Bash script I'm meaning is very simple: as Code:
cp -r folderCase/case1 folderCase/case2 sed -r etc etc... e.g this is one I made: Code:
#!/bin/bash
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
rm -r Z1
cp -r regionAirAmb Z1
cp -r stdCase/constantOrg/domain0 Z1/constant
cp -r stdCase/constantOrg/domain1 Z1/constant
cp -r stdCase/constantOrg/domain2 Z1/constant
cp -r stdCase/systemOrg/ Z1/
cp -f Z1/systemOrg/* Z1/system/
rm -r Z1/systemOrg/
mergeMeshes Z1 regionSolido -overwrite > log.mergeSolid
mergeMeshes Z1 regionAirComb -overwrite > log.mergeComb
cp -f stdCase/constantOrg/regionProperties Z1/constant
cd Z1/
rm -f *.vtk *.stl *.fms *.obj *.foam
touch 1.foam
renumberMesh -overwrite
mv -v system/changeDictionaryDictFirst system/changeDictionaryDict
changeDictionary
mv -v system/changeDictionaryDict system/changeDictionaryDictFirst
checkMesh > log.checkMesh
mv system/topoSetRegions system/topoSetDict
topoSet > log.topoSetRegionsCreation
mv system/topoSetDict system/topoSetRegions
splitMeshRegions -cellZones -overwrite > log.splitMeshRegions
rm -f 0/cellToRegion
rm -f system/fvSchemes system/fvSolution
for i in 0 1 2
do
rm -f 0/domain$i/cellToRegion
done
cp -rf ../stdCase/systemOrg/fvSchemes_fluid system/domain0/
cp -rf ../stdCase/systemOrg/fvSolution_fluid system/domain0/
cp -rf ../stdCase/systemOrg/fvSchemes_fluid system/domain2/
cp -rf ../stdCase/systemOrg/fvSolution_fluid system/domain2/
cp -rf ../stdCase/systemOrg/fvSchemes_Solid system/domain1/
cp -rf ../stdCase/systemOrg/fvSolution_Solid system/domain1/
for i in domain0 domain2
do
mv -v system/$i/fvSchemes_fluid system/$i/fvSchemes
mv -v system/$i/fvSolution_fluid system/$i/fvSolution
done
for i in domain1
do
mv -v system/$i/fvSchemes_Solid system/$i/fvSchemes
mv -v system/$i/fvSolution_Solid system/$i/fvSolution
done
for i in 0 1 2
do
cp -f ../stdCase/0org/* 0/domain$i
done
rm -r constant/polyMesh constant/cellToRegion
cd system/
#mv -v domain0/ fluid1
cp -f ../../stdCase/systemOrg/changeDictionaryDictFluid1 domain0/changeDictionaryDict
#mv -v domain1/ solid
cp -f ../../stdCase/systemOrg/changeDictionaryDictSolid domain1/changeDictionaryDict
#mv -v domain2/ fluid2
cp -f ../../stdCase/systemOrg/changeDictionaryDictFluid2 domain2/changeDictionaryDict
cd ..
#rm -r system/fvS*
for i in domain0 domain1 domain2
do
changeDictionary -region $i > log.changeDictionary.$i 2>&1
done
# remove fluid fields from solid regions (important for post-processing)
for i in domain1 #solid
do
rm -f 0*/$i/{mut,alphat,epsilon,k,U,p_rgh}
done
## remove solid fields from fluid regions (important for post-processing)
for i in domain0 domain2 #fluid1 fluid2
do
rm -f 0*/$i/{Ypmma,Ychar}
done
cd system/
for i in domain0 domain1 domain2
do
cp -f decomposeParDict $i
done
cd ..
cp -f system/topoSetFlame system/domain2/topoSetDict
topoSet -region domain2
cp -f ../stdCase/constantOrg/fvOptions constant/domain2/
decomposePar -allRegions
mpirun -np 6 chtMultiRegionSimpleFoam -parallel > log.run
#-----------------------------------------------------------------------------
Good luck. |
|
|
|
|
|
|
|
|
#5 |
|
Member
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 11 ![]() |
Many thanks again for the kind help. I have attached the 0 folder in one of the cases and all I would like to do is to change the velocity in the include folder using your script to run it using an array of different velocities
![]() 0.zip Thanks again in advance, |
|
|
|
|
|
|
|
|
#6 | |
|
Senior Member
|
Quote:
Sent from my ASUS_X008D using CFD Online Forum mobile app |
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [OpenFOAM.org] Install openFOAM 3.0.1 in Ubuntu 16.04 LTS from Deb packs | Pier84 | OpenFOAM Installation | 4 | June 18, 2016 17:22 |
| running multiple parallel cases in openfoam slows the simulation | kkpal | OpenFOAM Running, Solving & CFD | 2 | August 21, 2015 12:08 |
| Running multiple designpoints on a linux machine (parallel) | cfdnoob | ANSYS | 1 | August 18, 2015 12:12 |
| Running in parallel on multiple nodes | kalyangoparaju | OpenFOAM | 5 | January 18, 2012 12:36 |
| Statically Compiling OpenFOAM Issues | herzfeldd | OpenFOAM Installation | 21 | January 6, 2009 10:38 |