Enforcing periodic boundary conditions #16419
-
Hi everyone, I would like to enforce that the displacement of two nodes on opposite sides of my mesh to have not the same value, but actually a value that I would like to pass along, i.e. u^2 - u^1 = A, with u^2 and u^1 the values of opposite nodes and A is the value I want to give. Is it possible to use the Constraints System (https://mooseframework.inl.gov/syntax/Constraints/index.html) for that? Or how would I enforce such a constraint? Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
See the section on "Function Transform Periodic Boundaries" on the AddPeriodicBCAction page. Will something like this work for you? I think you could just make u^1 your primary boundary and define the transform to the u^2 secondary boundary like: u^2 = A + u^1. |
Beta Was this translation helpful? Give feedback.
-
@tairoon1 I whipped up a little something for you on my MOOSE app. I basically copy and pasted the code for
To use The object works pretty well, but proceed at your own risk. I didn't put very much effort into writing the code - just wanted to demonstrate how you, yourself, could begin to solve your problem with MOOSE. I'm not sure what sort of physics you are working with, but I created two fairly simple tests: one that solves a diffusion problem and another that solves a solid mechanics problem.
You can basically use my code as a template and create a more formal |
Beta Was this translation helpful? Give feedback.
-
If you are after periodic strain, you can check this out, https://mooseframework.inl.gov/moose/syntax/Modules/TensorMechanics/GlobalStrain/ |
Beta Was this translation helpful? Give feedback.
@tairoon1 I whipped up a little something for you on my MOOSE app. I basically copy and pasted the code for
LinearNodalConstraint
and modified it to solve the residual: R = u1 - u2 + A. You can find the source code here:EqualValuePlusConstant.h
EqualValuePlusConstant.C
To use
EqualValuePlusConstant
(lack of a better name), just copy and paste these files into your own MOOSE app and be sure to changeregisterMooseObject("YourAppName", EqualValuePlusConstant);
to reflect "YourAppName" in the.C
file.The object works pretty well, but proceed at your own risk. I didn't put very much effort into writing the code - just wanted to demonstrate how you, yourself, could begin to solve your proble…