-
Notifications
You must be signed in to change notification settings - Fork 2
add OpenFOAM test case: rotating cylinder #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for implementing this:)
Ideally we would now need a parameter file (.json) and a script that inserts the parameters from the json into the appropriate files for OpenFOAM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this a file that can be replaced by the Snakemake file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Allrun-script is established in OpenFOAM to run simulations, often containing 5 or more steps, which need to be executed (calling applications, moving/deleting files, sometimes receiving input parameters from the CLI). This is the way.
As discussed in the previous comments, we are going to remove the post-processing from this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the file that we would need to change in order to set the mesh-density?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
|
How is the planned procedure to this merge request? There are some details missing, including a short documentation, a final integration into the workflows (nextflow and snakemake) as well as an extraction of relevant metrices to compare the performance into a metrics.json file (together with a class that actually provides the analytical solution). @mschwarzmeier or @tmaric do you plan on working on this any further, or should we close the merge request and the corresponding issue? |
|
There is one open question, which is whether snakemake or nextflow needs to be used. Have you reached a conclusion in that regard, @joergfunger? |
|
@mschwarzmeier thanks for the fast response. We have modified the snakemake and nextflow workflows, so they now use exactly the same structure, i.e. if you have written a snakemake workflow, I guess the transformation into the corresponding nextflow equivalent is relatively straightforward. I will try to shortly describe the current approach, and maybe that than helps to identify/understand the challenges you are facing. We have first defined a simulation problem that has a certain number of parameters, these could be changes in the geometry, mesh, constitutive parameters, bc ... These parameters are stored in a parameter file. Then, there are two options to run the (single simulation) - either the parameter file is passed to a python function as we do in fenics and then use these parameters directly - this is possible if your input is based on a programming language such as python. The other option, as we have done with kratos, is to prepare a a simulation template (e.g. here for kratos that has at all positions, where a parameter is to be changed as placeholder (marked with {{}}). The first step would then be replacing in the template the parameters of the parameter file, then run the simulation as an external tool, and then collect the data into both a metrics file that includes all the relevant output metrics used in a comparison afterwards, usually scalars or vectors and a complete result files are also stored in a zip file (solution_field_data_*), though there is (at least currently) no defined general structure in that zip file. This would then e.g. include result files as vtk. So you would have to define one input file for openfoam, define what the parameters are that you want to make flexible, define these with placeholders and then replace them when running the simulation. We have made the workflows hierarchical, such that some parts (such as mesh generation or generation of the summary file) are done on the top level, and then there are individual steps for each software tool Kratos Snakefile that are included in the top level file. So if you use snakemake, you would essentially have to copy the Snakefiles at the top level and one on the tool level, define the parameter files, adapt the generate_config file and then call the corresponding scripts in the rules. If mesh generation is not to be automated, just provide the meshes in a standard format and then use those as input files rather then generating them in an automatic rule beforehand. |
|
Hi @joergfunger, |
|
@mschwarzmeier thanks for writing the snakefile. This is a very good starting point. There are a couple of things that I would suggest:
|
Implements OpenFOAMs rotating cylinder tutorial.
Open points:
closes #12