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

Mesh refinement + mesh modification + prism6 does not create expected variable continuity #29125

Open
5 tasks done
GiudGiud opened this issue Nov 23, 2024 Discussed in #29079 · 0 comments
Open
5 tasks done
Labels
C: Modules/Solid Mechanics Tickets pertaining to the solid_mechanics module P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.

Comments

@GiudGiud
Copy link
Contributor

Description

When running a 2 hex cell with top cell being refined, a classic pressure on top problem, anchor on bottom produces the expected solution in the regular case and when there is a mesh modifier that switches the subdomain assignments between the initial mesh and the mesh on which the BC is applied
With prisms, the solution is not right in that second case.
The solution is right without any block restriction on displacements

Note that in some configuration (when moving all elements to subdomain 1), the activation of the BC causes a seg fault. Unclear why at the moment

How to reproduce

Run this input with solid mechanics:

[Problem]
  kernel_coverage_check = false
  material_coverage_check = false
  boundary_restricted_node_integrity_check = false
  boundary_restricted_elem_integrity_check = false
[]

new_domain_blocks = '1001 1001'

[Mesh]
  [box]
    type = FileMeshGenerator
    file = msh.msh
  []

  [refine]
    type = RefineBlockGenerator
    input = box
    block = '2'
    refinement = '1'
    # enable_neighbor_refinement = false
  []

  add_subdomain_ids = '${new_domain_blocks}'
[]


[GlobalParams]
  displacements = 'disp_x disp_y disp_z'
[]

[Variables]
  [disp_x]
    block = '${new_domain_blocks}'
  []
  [disp_y]
    block = '${new_domain_blocks}'
  []
  [disp_z]
    block = '${new_domain_blocks}'
  []
[]

# ===== Tensor mechanics for all active domain blocks =====
[Physics]
  [SolidMechanics]
    [QuasiStatic]
      [all]
        strain = finite
        add_variables = false
        block = '${new_domain_blocks}'
        generate_output = 'stress_xx stress_zz'
      []
    []
  []
[]

# ===== Gravity =====
[Kernels]
  # [n1]
  #   type = NullKernel
  #   block = '1 2'
  #   variable = disp_x
  # []
  # [n2]
  #   type = NullKernel
  #   block = '1 2'
  #   variable = disp_y
  # []
  # [n3]
  #   type = NullKernel
  #   block = '1 2'
  #   variable = disp_z
  # []
  [Gravity1]
    type = BodyForce
    block = '${new_domain_blocks}'
    use_displaced_mesh = false
    variable = disp_z
    value = -10
  []
[]

# ===== Boundary Conditions =====
[BCs]
  [archor_x]
    type = DirichletBC
    boundary = '3'
    variable = disp_x
    value = 0
  []

  [archor_y]
    type = DirichletBC
    boundary = '3'
    variable = disp_y
    value = 0
  []

  [archor_z]
    type = DirichletBC
    boundary = '3'
    variable = disp_z
    value = 0
  []

  [dz]
    type = FunctionNeumannBC
    boundary = '4'
    variable = disp_z
    function = '-2e3 * (t - 200)'
  []
[]

# ===== Materials (linear-elastic to keep it simple) =====
[Materials]
  [elasticity_tensor1]
    type = ComputeIsotropicElasticityTensor
    block = '${new_domain_blocks}'
    youngs_modulus = 50E6 # 50 MPa
    poissons_ratio = 0.3
  []

  [stress]
    type = ComputeFiniteStrainElasticStress
    block = '${new_domain_blocks}'
  []

  [density1]
    type = GenericConstantMaterial
    block = '${new_domain_blocks}'
    prop_names = density
    prop_values = 2000
  []
[]

[MeshModifiers]
  [m1]
    type = TimedSubdomainModifier
    times = '100 100'
    blocks_from = '1 2'
    blocks_to = ${new_domain_blocks}
    execute_on = 'TIMESTEP_BEGIN'
  []
[]

[Controls]
  [c1]
    type = TimePeriod
    enable_objects = 'BCs::dz'
    start_time = '200'
  []
[]

# ===== Executioner =====
[Executioner]
  type = Transient

  end_time = 600
  dt = 100

  solve_type = 'PJFNK'
  petsc_options = '-snes_converged_reason'

  petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
  petsc_options_value = '  201               hypre    boomeramg      10'

  nl_abs_tol = 5E-9
  nl_max_its = 400

  l_tol = 1E-8
  l_max_its = 200
[]

[Outputs]
  exodus = true
[]

Impact

Wrong results

Discussed in #29079

Originally posted by PEI0214 November 14, 2024

Check these boxes if you have followed the posting rules.

  • Q&A General is the most appropriate section for my question
  • I have consulted the posting Guidelines on the Discussions front page
  • I have searched the Discussions forum and my question has not been asked before
  • I have searched the MOOSE website and the documentation does not answer my question
  • I have formatted my post following the posting guidelines (screenshots as a last resort, triple back quotes around pasted text)

Question

Hello,
When I use mesh refinement and MeshModifiers together, the following happens. This doesn't seem normal. When the grid is 8-node cells, this phenomenon does not occur.

Grid and result

The 6-node grid and results are as follows:
image
image

The 8-node grid and results are as follows:
image
image

The setting of boundary conditions and mesh refinement are the same. It's all full restraint on the bottom and pressure on the top. Why does this happen?
@GiudGiud GiudGiud added T: defect An anomaly, which is anything that deviates from expectations. P: normal A defect affecting operation with a low possibility of significantly affects. C: Modules/Solid Mechanics Tickets pertaining to the solid_mechanics module labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Modules/Solid Mechanics Tickets pertaining to the solid_mechanics module P: normal A defect affecting operation with a low possibility of significantly affects. T: defect An anomaly, which is anything that deviates from expectations.
Projects
None yet
Development

No branches or pull requests

1 participant