37. dakota_of.in
37
# DAKOTA INPUT
method,
# npsol_sqp
# if NPSOL is not available, comment the above and try the following instead:
conmin_frcg
variables,
continuous_design = 1
cdv_initial_point0.1
cdv_lower_bounds 0.1
cdv_upper_bounds 5.0
cdv_descriptor 'Uin'
interface,
system
# asynchronous
analysis_driver = 'run_openfoam.sh'
parameters_file = 'params.in'
results_file = 'results.out'
work_directory directory_tag
copy_files = 'airFoil2D.template/*'
# uncomment to leave params.in and results.out files in work_dir subdirectories
named 'workdir' file_save directory_save
aprepro
# when using conmin_frcg (above) with analytic_gradients (below),not
# need to turn off the active set vector as rosenbrock_bb does parse it.
## deactivate active_set_vector
responses,
num_objective_functions = 1
numerical_gradients
fd_gradient_step_size = 0.000001
# to instead use analytic gradients returned by the simulator comment the
# preceding two lines and uncomment the following:
## analytic_gradients
no_hessians
dakotaは、
airFoil2D.template をコピーして、
run_openfoam.sh params.in results.out
を実行する。
パラメタ探索方法
パラメタ動作範囲
応答処理方法
38. run_openfoam.sh
38
#!/bin/sh
# Sample simulator to Dakota system call script
# See Advanced Simulation Code Interfaces chapter in Users Manual
# $1 is params.in FROM Dakota
# $2 is results.out returned to Dakota
#--------------
#PRE-PROCESSING
#--------------
#Incorporate the parameters from DAKOTA into the template, writing ros.in
#Use the following line if SNL's APREPRO utility is used instead of DPrePro.
#../aprepro -c '*' -q --nowarning ros.template ros.in
dprepro $1 0/U.template 0/U
# --------
# ANALYSIS : Run OpenFOAM
# --------
pwd
simpleFoam
# ---------------
# POST-PROCESSING
# ---------------
echo "current directory in" ; pwd
# extract L and D from final step of forces file and output –L/D to temporally file
tail -1 postProcessing/forces/0/forces.dat | sed s/[(),]/" "/g | awk -F" " '{print -($3+$6)/($2+$5)}' > OF_LbyD_results.tmp
cat OF_LbyD_results.tmp
mv OF_LbyD_results.tmp $2
run_openfoam.sh params.in results.out
$1(params.in) に則って0/U.template をプリプロ
セス処理(dprepro)して、 0/U を作成する。
simpleFoam の実行
ポストデータ処理した結果を $2(results.out)に出力
83. dakota_of.in
83
## DAKOTA INPUT FILE - dakota_of.in
method,
# npsol_sqp
# if NPSOL is not available, comment the above and try the following instead:
conmin_frcg
variables,
continuous_design = 4
cdv_initial_point0.5 0.1 0.5 -0.5
cdv_lower_bounds 0 0.1 0 -1
cdv_upper_bounds 1 0.5 1 -0.1
cdv_descriptor 'x1' 'y1' 'x2' 'y2'
interface,
system
# asynchronous
analysis_driver = 'run_openfoam.sh'
parameters_file = 'params.in'
results_file = 'results.out'
work_directory directory_tag
copy_files= 'airFoil2D.template/*'
# uncomment to leave params.in and results.out files in work_dir subdirectories
named 'workdir' file_save directory_save
aprepro
# when using conmin_frcg (above) with analytic_gradients (below),
# need to turn off the active set vector as rosenbrock_bb does not parse it.
## deactivate active_set_vector
responses,
num_objective_functions = 1
numerical_gradients
fd_gradient_step_size = 0.05
# to instead use analytic gradients returned by the simulator comment the
# preceding two lines and uncomment the following:
## analytic_gradients
no_hessians
dakotaは、
airFoil2D.template をコピーして、
run_openfoam.sh params.in results.out
を実行する。
パラメタ探索方法
パラメタ動作範囲
応答処理方法
84. run_openfoam.sh
84
#!/bin/sh
# Sample simulator to Dakota system call script
# See Advanced Simulation Code Interfaces chapter in Users Manual
# $1 is params.in FROM Dakota
# $2 is results.out returned to Dakota
# --------------
# PRE-PROCESSING
# --------------
# Incorporate the parameters from DAKOTA into the template, writing ros.in
# Use the following line if SNL's APREPRO utility is used instead of DPrePro.
# ../aprepro -c '*' -q --nowarning ros.template ros.in
dprepro $1 system/blockMeshDict.template system/blockMeshDict
# --------
# ANALYSIS : Run OpenFOAM
# --------
#cd airFoil2D.template
pwd
blockMesh
simpleFoam
#cd ..
# ---------------
# POST-PROCESSING
# ---------------
echo "current directory in" ; pwd
tail -1 postProcessing/forces/0/forces.dat | sed s/[(),]/" "/g | awk -F" " '{print -($3+$6)/($2+$5)}' > OF_LbyD_results.tmp
cat OF_LbyD_results.tmp
mv OF_LbyD_results.tmp $2
run_openfoam.sh params.in results.out
$1(params.in) に則って
sysyem/blockMeshDict.template をプリプロセ
ス処理(dprepro)して、 system/blockMeshDict
を作成する。blockMesh
simpleFoam の実行
ポストデータ処理した結果を $2(results.out)に出力