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

Running Multiple cases using Dakota!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2017, 20:02
Default Running Multiple cases using Dakota!
  #1
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 10
CFD-Lover is on a distinguished road
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
Can dakota be used for such cases?

Thanks,
CFD-Lover is offline   Reply With Quote

Old   April 28, 2017, 07:37
Default
  #2
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
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
student666 is offline   Reply With Quote

Old   April 28, 2017, 10:56
Thumbs up
  #3
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 10
CFD-Lover is on a distinguished road
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,
CFD-Lover is offline   Reply With Quote

Old   April 28, 2017, 12:58
Default
  #4
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
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...
You can have some hints on tutorials allrun scripts and great help is Google.

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

#-----------------------------------------------------------------------------
basically, I write down Linux bash command on a file and then I execute it.

Good luck.
student666 is offline   Reply With Quote

Old   April 28, 2017, 13:09
Thumbs up
  #5
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 10
CFD-Lover is on a distinguished road
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,
CFD-Lover is offline   Reply With Quote

Old   April 28, 2017, 14:52
Default
  #6
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Quote:
Originally Posted by student666 View Post

basically, I write down Linux bash command on a file and then I execute it.

Good luck.


Sent from my ASUS_X008D using CFD Online Forum mobile app
student666 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
[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


All times are GMT -4. The time now is 13:40.