Skip to content
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 FEniCS as a solid participant for elastic-tube-3d #222

Merged
merged 22 commits into from
Feb 7, 2022

Conversation

IshaanDesai
Copy link
Member

This PR adds FEniCS as a solid participant to the elastic-tube-3d case.

@IshaanDesai IshaanDesai changed the title Add FEniCS participant to elastic-tube-3d case Porting elastic-tube-3d case and adding FEniCS as a solid participant Jun 27, 2021
@IshaanDesai IshaanDesai marked this pull request as ready for review July 6, 2021 08:47
@IshaanDesai
Copy link
Member Author

IshaanDesai commented Jul 6, 2021

THIS ERROR IS NO LONGER SEEN
Currently the results in FEniCS show an error. The edge of the tube at z=0.005 appears to not be constrained with zero displacement and actually moves as the neighboring nodes are displaced. This can be seen by placing a Point at (0, 0, 0.005) and observing the tube edge.
Screenshot from 2021-07-06 10-49-36
The fixed boundaries are defined in the following way:

def clamped_boundary(x, on_boundary):
"""
Filter nodes at both ends of tube as they are fixed
"""
tol = 1E-14
return on_boundary and ((x[2] - 0.0) < tol) and ((x[2] - L) < tol)

and the clamped boundary is defined in FEniCS as:
fixed_boundary = AutoSubDomain(clamped_boundary)

and the constraint of zero displacement is applied in the following way:
bc = DirichletBC(V, Constant((0, 0, 0)), fixed_boundary)

Currently there is no reasonable explanation why the tube end nodes displace. @BenjaminRodenberg do you have an idea what is going wrong?
Resolved in a later commit.

@IshaanDesai IshaanDesai added this to the v202104.2.0 milestone Aug 4, 2021
@IshaanDesai IshaanDesai changed the title Porting elastic-tube-3d case and adding FEniCS as a solid participant Add FEniCS as a solid participant for elastic-tube-3d Aug 7, 2021
@precice-bot
Copy link
Collaborator

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/does-the-fenics-adapter-support-3d-case/696/2

Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the case is overall working. I'm a bit concerned about the results compared to the CalculiX solver, but not sure if this is in scope of this PR.

@@ -49,6 +49,7 @@
<use-mesh name="Fluid-Mesh-Faces" from="Fluid" />
<write-data name="DisplacementDelta" mesh="Solid-Mesh" />
<read-data name="Force" mesh="Solid-Mesh" />
<watch-point mesh="Solid-Mesh" name="Tube-Midpoint" coordinate="0.0;0.005;0.025" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to generally keep this watchpoint or did you just introduce it for verification of the results? Please add an image of the results to the README.md of this case similar to https://github.com/precice/tutorials/tree/master/perpendicular-flap#post-processing. This helps a lot when releasing and checking the cases. Please also provide a script (you can probably just use a modified version of https://github.com/precice/tutorials/blob/master/perpendicular-flap/plot-all-displacements.sh).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already added a script to this PR. Here is the plot that I created:

tutorials-elastic-tube-3d-displacement-all-watchpoints

The circumferential displacement is (for both solid solvers) negligible as expected. The radial and axial displacement also looks good (as far as I can judge here...). What worries me a bit is the large difference between the CalculiX and the FEniCS case. Do you also observe this? It might also be a problem with my system, because I did not update CalculiX or the adapter for quite a while.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What worries me a bit is the large difference between the CalculiX and the FEniCS case. Do you also observe this? It might also be a problem with my system, because I did not update CalculiX or the adapter for quite a while.

I am aware that there is a large difference in the results of CalculiX and FEniCS. I think this is the case because of the choice of the elements and also the solvers in CalculiX and FEniCS. The CalculiX participant has C3D10 elements. For the FEniCS participant we use the Cylinder function to construct the geometry. The FEniCS version we use offers very little control over the type of elements we can have, especially when we use in-built geometry constructing functions. In FEniCS-X there is greater control over the choice of elements.

I think we should not worry too much about having the same results with CalculiX and FEniCS for this case as it is a complex case which also takes a long time to run. We can present this tutorial merely as a case to showcase the 3D functionality.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. It's already good to have an example for 3D the disagreement between FEniCS and CalculiX is a different story. Can you document it in an issue and also add the possible reasons you mentioned above?

elastic-tube-3d/solid-fenics/solid.py Outdated Show resolved Hide resolved
elastic-tube-3d/solid-fenics/solid.py Outdated Show resolved Hide resolved
elastic-tube-3d/solid-fenics/solid.py Outdated Show resolved Hide resolved
elastic-tube-3d/solid-fenics/solid.py Outdated Show resolved Hide resolved
elastic-tube-3d/solid-fenics/solid.py Outdated Show resolved Hide resolved
Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disagreement between CalculiX and FEniCS should be documented in an issue. Rest is good to go 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants