-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Subcycling in partitioned heat conduction: OpenFOAM #406
Subcycling in partitioned heat conduction: OpenFOAM #406
Conversation
@fsimonis trace logs: |
With precice/precice#1892, this seems to work for me. |
@davidscn @BenjaminRodenberg this is ready to be reviewed and works with the latest |
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.
Works in principle. The error is for both OpenFOAM-OpenFOAM cases (t=0.1
and t=0.01
) almost the same though.
with subcycling:
l2 error (sqrt(sum(err^2)/n)): 0.0944029
without subcycling
l2 error (sqrt(sum(err^2)/n)): 0.0944041
Not sure what to expect here in terms of accuracy gain, I could compare with a higher-order (in space) FE code if desired. Technically, the changes work of course.
Generally the error looks pretty large to me. For the FEniCS case I get the exact solution. But maybe this also has something to do with the different space discretization and therefore the space discretization error is shadowing the time discretization error in your case for any setup. |
The interesting part here is to compare Here, I guess it is already good news that everything works and subcycling does not introduce any error. If you want to compare to the v2.5 implementation of this case: There you usually see some error, if you use subcycling. |
Previously, subcycling was not even working, as we discovered at some point. I would suggest merging this and creating a separate issue for investigating the errors, as I am afraid this could take us into a very deep dive. Unless you think that something is terribly wrong and we should investigate before releasing the v3-variant of the OpenFOAM adapter. |
No it's ok. I guess the space resolution is not particularly high in our case and I would have to take a deeper look into the error calculation. This is good to go here and I would only open an issue if you have some suspicion about the correctness of the results. |
Do I understand correctly that FEniCS defines a 10x10 mesh? What kind of elements are these?
In OpenFOAM we define a 100x100 mesh:
Are we using the same convergence criteria? I see some
In OpenFOAM, the solver uses
|
The mesh does not matter for this setup, if you do everything correctly and do not introduce any errors (adapter, incorrect BCs, preCICE). I'm using second order Lagrange elements in the FEniCS case. This is not the case because they are absolutely needed for the original problem as a second degree polynomial solution means first degree elements would be fine. We need second degree elements because otherwise the reconstructed heat flux (gradient of temperature) would be incorrect (grad of piecewise linear has jumps). In the corresponding chapter of the FEniCS tutorials book you can also find some more information on the monolithic setup and the method of manufactured solutions (https://fenicsproject.org/pub/tutorial/pdf/fenics-tutorial-vol1.pdf). @MakisH the |
So, @BenjaminRodenberg @davidscn should we merge this already, or not? |
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 would merge this PR. The subcycling implementation looks ok.
I guess there was already an error/inaccuracy (compared to the FEniCS case) in how you are treating the boundary conditions before. I would suggest to open an issue and try to fix this to reach the same accuracy as for the FEniCS case without subcycling in a separate PR. Not sure whether this is actually possible with OpenFOAM: In FEniCS, I needed 2nd order FEM to do the trick with the flux. I have no idea about the capabilities of OpenFOAM and FV here.
Follow-up of #281. Needs the latest preCICE develop (precice/precice#1892).
(outdated)
This is actually exploding at the moment:It works without subcycling.