-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add partitioned-heat OpenFOAM participant with solver #223
Conversation
Are the solver files part of OpenFOAM? If yes, why include them here? (guessing from the copyright notices) |
No they are not, just started from OpenFOAM own files, |
@davidscn Could you also please quickly comment here which results you get? (I did not run the case yet). Do you get the correct results when e.g. coupling to FEniCS? Edit: Just saw that you already added the results in precice/openfoam-adapter#93 |
We do the same for FEniCS and Nutils. If they are not part of OpenFOAM, the right way to got is indeed to add them here in my opinion. |
Definitely, but currently the copyright notices look as if these solvers are part of OpenFOAM v2012, that's why I got confused. |
I see. How should / could we change the copyright notice? Just remove? |
@davidscn knows best here. If the code is mostly from OpenFOAM with some small changes, then keep the headers as they are and write some "extended by" (David, preCICE, whatever policy we want to have). If the code is mostly new, then I don't see any need for detailed copyright notices, maybe only an attribution such as "based on previous work on X by Y". |
I wrote some custom text in order to highlight from where we started.. |
This PR is now ready to go. As documented in the issue, it works as expected. I only need to update the documentation if we want to merge it. Any volunteer how wants to try out the actual tutorial (groovyBC required)? |
To which documentation are you referring? Let's wait for the changelog PR from @IshaanDesai such that we can also document this change. |
https://precice.org/tutorials-partitioned-heat-conduction.html |
I need some documentation to build the OpenFOAM solvers 😁 A new inconsistency issue is now the folder structure 😕
|
Hm, not sure which part is inconsistent. Merging the OpenFOAM cases is, however, not possible as long as we explicitly want to run the OpenFOAM-OpenFOAM coupling. EDIT: We also have the problem where to put the solver files. Duplicating them into both OF cases is certainly a bad idea. |
I think that We have a kind-of-similar situation in the elastic-tube-1d. Previously, the Python solvers were sharing some files, which we merged into the solvers to not have this issue (e.g. hard-code parameters, instead of using configuration files, move the tools to the root directory). If we have the duplication there, we could also have it here, if it helps the structure. An alternative we already use in the repository to avoid duplications is symbolic links. Another alternative would be to have the solvers in a |
Yes, we could duplicate ... @BenjaminRodenberg might not like this idea? (I think we had this discussion already) Symbolic links or The other alternative is to keep it as it is and just be careful to properly document the "how to run" in the README. |
Yes, we had such a discussion already and I understand that this duplication avoidance was the original motivation. My main counterargument was (and remains here) that special cases can lead again to a difficult to maintain situation and can make automation harder. But I completely understand that this is not a trivial case that fits nicely into our current structure.
For me too. However, I think the structure breaks because normally we assume that the solver already exists and the tutorial is only a set of config files. So, if we want to stick to the structure, we should try to separate the solver from the configs. One way is to have the solvers in a directory of a standardized name inside each tutorial case.
I am afraid this will set a precedent for more special cases in the future, so I would prefer to adjust the system now. |
I quickly skimmed over this PR. I would suggest to merge the structure as it is
And yes. I don't like this idea 😅 We could stick to our structure by introducing some links (e.g. |
We could still draft the "duplication" idea. I can imagine that it also has some possible benefits. Right now |
Ok, then I would continue with the following structure: .
├── clean-tutorial.sh -> ../tools/clean-tutorial-base.sh
├── fenics
├── images
├── nutils
├── openfoam-dirichlet
├── openfoam-neumann
├── openfoam-solver
├── precice-config.xml
└── README.md |
Please don't forget |
Done #228 |
2369874
to
8ecbbe2
Compare
Ok, ready for review. I guess every potential reviewer is now already notified. |
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.
A quick first review. Please trigger me again afterwards to try it.
|
||
CHT | ||
{ | ||
k [ 1 1 -3 -1 0 0 0 ] -1; |
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.
Why the -1
here?
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.
Compatibility. fenics
and nutils
have different sign conventions here.
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.
Are we then restricted to which solver combinations we can run? Can the user still select between openfoam-openfoam
, openfoam-nutils
, fenics-openfoam
? I understand that now only the openfoam-<other>
and <other>-openfoam
are valid cases now. Maybe we could find a more fundamental solution to this.
If I am looking at the right places, this is not documented.
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.
Ah GitHub duplicated your comment, see the answer below.
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.
Ah GitHub duplicated your comment, see the answer below.
I am not sure if we found a GitHub bug or if I commented in the wrong places, but something confusing is going on here.
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 think you did not comment here but rather sent it with a new review. Too much confusion for GitHub. Anyway, let's consider the discussion.
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.
Compatibility. fenics and nutils have different sign conventions here.
Sounds like sth we need to resolve. All combinations should be possible without changing any of the participants.
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.
As documented below, all combinations work with the current setup.
partitioned-heat-conduction/openfoam-neumann/setInitialField.sh
Outdated
Show resolved
Hide resolved
partitioned-heat-conduction/openfoam-neumann/constant/transportProperties
Show resolved
Hide resolved
partitioned-heat-conduction/openfoam-dirichlet/system/controlDict
Outdated
Show resolved
Hide resolved
Done and ready to try. |
partitioned-heat-conduction/openfoam-dirichlet/system/controlDict
Outdated
Show resolved
Hide resolved
|
||
CHT | ||
{ | ||
k [ 1 1 -3 -1 0 0 0 ] -1; |
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.
Are we then restricted to which solver combinations we can run? Can the user still select between openfoam-openfoam
, openfoam-nutils
, fenics-openfoam
? I understand that now only the openfoam-<other>
and <other>-openfoam
are valid cases now. Maybe we could find a more fundamental solution to this.
If I am looking at the right places, this is not documented.
All combinations are valid as the sign cancels out for |
and adjust documentation as well as run scripts accordingly
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
8a0223c
to
b85f577
Compare
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 also ran it now and it works as expected. If you want, consider these two additional points and feel free to merge.
Done, thanks @MakisH |
Since #214 is a far away from its purpose and includes various changes I don't understand let me add a clean PR. The tutorial requires groovyBC in order to handle the time dependent inhomogenous Dirichlet boundary condition.
Open to discuss: this PR comprises the solver as well.