[Boundary Condition] Nonconforming traction BC (copy from xmpm branch)#66
[Boundary Condition] Nonconforming traction BC (copy from xmpm branch)#66
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Currently there are 2 optionsOverall notes
Constant PressureFor the constant pressure scenario (e.g. thick-walled cylinder), the following inputs are required: Specific Notes:
Hydrostatic PressureFor the hydrostatic pressure scearnio (e.g. body in fluid), the following inputs are required: Specific Notes
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #66 +/- ##
==========================================
- Coverage 95.71% 95.56% -0.15%
==========================================
Files 241 242 +1
Lines 50259 50650 +391
==========================================
+ Hits 48102 48399 +297
- Misses 2157 2251 +94 ☔ View full report in Codecov by Sentry. |
yliang-sn
left a comment
There was a problem hiding this comment.
It looks good to me. Thanks!
|
@jgiven100 Is this PR ready for review? |
Yes. |
|
Can you change the PR description then to help me understand the design? |
|
Will pull all updates from master at 1 time after #65 is merged |
|
I think you can pull now. I want to check #65 again later. |
bodhinandach
left a comment
There was a problem hiding this comment.
@yliang-sn @jgiven100 Thank you very much for your effort. This looks great. I have some comments which can improve the code. Also, I can help to make this parallel. The only bottleneck currently is to apply the forces from mesh, which I noted in my comments. Let's discuss this in person.
| // Fluid density for hydrostatic free surface | ||
| double fluid_density() const { return fluid_density_; } |
There was a problem hiding this comment.
I think this should be called material_density instead of fluid density.
include/mesh/mesh.h
Outdated
| bool create_nonconforming_traction_constraint( | ||
| const std::vector<double> bounding_box, const double datum, | ||
| const double fluid_density, const double gravity, const bool hydrostatic, | ||
| const bool inside, const std::shared_ptr<FunctionBase>& mfunction, | ||
| const double pressure); |
There was a problem hiding this comment.
Can we use "assign" instead of "create" to unify it with other constraints?
| // Find non-void cell connected with void cell | ||
| for (auto cell_neigh : (*citr)->neighbours()) { | ||
| if (map_cells_[cell_neigh]->nparticles() == 0) continue; | ||
| boundary_cell_list.insert((*citr)->id()); | ||
| boundary_cell_list.insert(map_cells_[cell_neigh]->id()); | ||
| for (auto node : map_cells_[cell_neigh]->nodes()) | ||
| boundary_node_list.insert(node->id()); | ||
| } |
| Eigen::Matrix<double, 6, 1> traction; | ||
| traction.setZero(); |
There was a problem hiding this comment.
This should be stress right? Since it is a 2nd order tensor. Traction is a vector.
include/mesh/mesh.tcc
Outdated
| // // Placeholder for arbitrary traction and divergence terms | ||
| // else { | ||
| // traction << 0., 0., 0., 0., 0., 0.; | ||
| // divergence_traction << 0., 0., 0.; | ||
| // } |
There was a problem hiding this comment.
How about defining this as an option in the initial input file?
| //! Minus the internal force of the virtual stress field | ||
| //! \param[in] traction Boundary traction | ||
| //! \param[in] divergence_traction Divergence of boundary traction | ||
| virtual void minus_virtual_stress_field( |
There was a problem hiding this comment.
update or apply instead of minus?
| if (Tdim == 2) { | ||
| force[0] = dn_dx_(i, 0) * traction[0] + dn_dx_(i, 1) * traction[3]; | ||
| force[1] = dn_dx_(i, 0) * traction[3] + dn_dx_(i, 1) * traction[1]; | ||
| } else if (Tdim == 3) { | ||
| force[0] = dn_dx_(i, 0) * traction[0] + dn_dx_(i, 1) * traction[3] + | ||
| dn_dx_(i, 2) * traction[5]; | ||
| force[1] = dn_dx_(i, 0) * traction[3] + dn_dx_(i, 1) * traction[1] + | ||
| dn_dx_(i, 2) * traction[4]; | ||
| force[2] = dn_dx_(i, 0) * traction[5] + dn_dx_(i, 1) * traction[4] + | ||
| dn_dx_(i, 2) * traction[2]; | ||
| } |
There was a problem hiding this comment.
I would suggest a template specialization so that you dont have to check the if else condition every time step.
| for (unsigned j = 0; j < Tdim; j++) | ||
| force[j] += shapefn_[i] * divergence_traction[j] * this->volume_; |
There was a problem hiding this comment.
Why can't you do it without the loop?
| for (unsigned j = 0; j < Tdim; j++) | |
| force[j] += shapefn_[i] * divergence_traction[j] * this->volume_; | |
| force.noalias() += shapefn_[i] * divergence_traction * this->volume_; |
3451dae to
c7b70b3
Compare
|
@bodhinandach Branch is successfully rebased:
Next steps:
|
|
Thanks @jgiven100 I will have a look into this. Does this utilize the optimized algorithm that you wrote in CPM or does this still use the initial approach written in CMAME? |
|
This corresponds to the initial approach as described in CMAME paper. If we use the "extra efficient" approach described in the CPM paper, I would not recommend coupling with high-order shape function. The non-constant shape function gradients have too much sensitivity on particle position, which introduces unacceptable instability. Since you have mentioned you are most interested in using VSB method + B-Spline MPM, we can very easily extend the CMAME approach. |
|
Understood, thanks! |
860eec6 to
1249585
Compare
Describe the PR
Overview
Add new class for
NonconformingTractionConstraintthat allows for a Nonconforming Tractiong Constraint to be applied. The constraint supports either constant pressure (e.g., pressure vessel problem) or hydrostatic pressure (e.g., levee probem) along a free surface. These features are toggled viainput.JSON.For nodes "close" to the boundary,
f_intandf_extmust be updated.Internal nodal force is updated such that:
External nodal force is updated such that:
Simple Boundary Detection
PR Includes a simple algorithm to detect which cells are along the material boundary.
Therefore, only nodes located "close" to the boundary (and have particles within their support) have
f_intandf_extupdated.Related Issues/PRs
N/a.
Additional context
N/a.