Jump to content
Yukai

openfoam optimization parameter settings questions

Recommended Posts

Hello
I have some questions !!

I have completed the openfoam connection and executed it successfully, but I would like to ask how I want to set the optimization parameter file. In the example, there is a pin.dat file that can be set as a parameter, and after my current openfoam value calculation is completed, it will Generate force .dat file, how do I set it to the optimization parameters?

I am currently writing a python program that allows it to calculate the force.dat file into a total resistance parameter and write it into a blank dat file so that this parameter can be used as an optimized setting, but I am not sure about my approach. Can the effect be achieved?

In addition, I would like to ask how the force.dat file cannot be written by caeses after the openfoam execution is completed, and the path generated by it is a bit wrong. How do I need to change it?

As shown in the red circle in the picture

The correct path should be /home/ncku514/Desktop/kcsopenfoam1030/1107KCSRHINO/manual_results/baseline/openfoam/postProcessing/force1/0/force.dat

But he is missing /postProcessing/force1/0/

 

 

Thanks for your help!!!

 

Best Regards

YuKai

questions.jpg

Share this post


Link to post
Share on other sites

Hi Yukai,


OpenFOAM is notably complex when it comes to managing numerous processed files. To address this complexity, I've included a screenshot featuring a standard connection input file, geometries, output files, and corresponding values. It's advisable to consistently employ relative paths by utilizing the subfolder option, as illustrated in the second screenshot.

To extract parameters from the force.dat file, you can directly navigate to the last line, which typically represents the converged value from OpenFOAM. This can be achieved using the -1 option in the command line.

Moreover, consider incorporating a Python file for post-processing and integrating it into your connection. This can be facilitated by incorporating the Python script as a command line within the Allrun.sh executable file.

Best Regards,
Andreas

image.png

image.png

  • Upvote 1

Share this post


Link to post
Share on other sites
On 11/28/2023 at 4:16 PM, Andreas Arapakopoulos said:

Hi Yukai,


OpenFOAM is notably complex when it comes to managing numerous processed files. To address this complexity, I've included a screenshot featuring a standard connection input file, geometries, output files, and corresponding values. It's advisable to consistently employ relative paths by utilizing the subfolder option, as illustrated in the second screenshot.

To extract parameters from the force.dat file, you can directly navigate to the last line, which typically represents the converged value from OpenFOAM. This can be achieved using the -1 option in the command line.

Moreover, consider incorporating a Python file for post-processing and integrating it into your connection. This can be facilitated by incorporating the Python script as a command line within the Allrun.sh executable file.

Best Regards,
Andreas

image.png

image.png

Hi Andreas Arapakopoulos

Thank you very much for replying to me

I currently use python to calculate the force in the X-axis direction in the forces.dat file, and output a calculated dat file. I also write it to Allrun for execution. Can this calculated dat file be regarded as the best Is it a numerical value?

Or would it be better for me to directly use the last value in the forces.dat file as the optimized value as you said?

Share this post


Link to post
Share on other sites

Hi Yukai,

The force in the last line is the converged value from the solver.

I would suggest to use a python code only for post-processing.

For example, if you want to plot the convergence history of the forces over OpenFOAM iterations.

By parsing various values, such as force in x-axis to parameters and establishing a robust integration CAESES with OpenFOAM, then you can continue with a Design of Experiments and/ or with a Optimization process.

Best Regards,

Andreas

  • Upvote 1

Share this post


Link to post
Share on other sites
On 11/30/2023 at 5:37 PM, Andreas Arapakopoulos said:

Hi Yukai,

The force in the last line is the converged value from the solver.

I would suggest to use a python code only for post-processing.

For example, if you want to plot the convergence history of the forces over OpenFOAM iterations.

By parsing various values, such as force in x-axis to parameters and establishing a robust integration CAESES with OpenFOAM, then you can continue with a Design of Experiments and/ or with a Optimization process.

Best Regards,

Andreas

Hi Andreas Arapakopoulos

Thank you very much for replying to me

I know how I do it

p.s. If I have any other questions in the future, can I ask you?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...