moose icon indicating copy to clipboard operation
moose copied to clipboard

Block restriction of nodal variables with a damper currently causes a seg fault

Open GiudGiud opened this issue 2 months ago • 0 comments

Description

Possibly related to https://github.com/idaholab/moose/issues/21645 in the origin for no support for block restriction Seg fault on block restricting damped nonlinear variable

How to reproduce

Block restrict a damped NL variable

Impact

More capability

Discussed in https://github.com/idaholab/moose/discussions/32050

Originally posted by PengWei97 December 5, 2025

Check these boxes if you have followed the posting rules.

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

Question

Dear MOOSE team,

I have a mesh with two touching blocks:

  • Block 1: electrode – variable theta_m is defined here
  • Block 2: electrolytetheta_m is not defined here

I want to use:

[Dampers]
  [./limit_theta_m]
    type         = BoundingValueNodalDamper
    variable     = theta_m
    min_value    = 0.0
    max_value    = 1.0
  [../]
[]

to keep theta_m within physical bounds during nonlinear iterations.


🔴 Problem

If I enable the damper, the simulation crashes with a segmentation fault:

Time Step 1, time = 0.1, dt = 0.1
 0 Nonlinear |R| = 6.318228e-06
      0 Linear |R| = 6.318228e-06
      1 Linear |R| = 1.528764e-06
      2 Linear |R| = 7.777395e-07
      3 Linear |R| = 1.998457e-07
      4 Linear |R| = 4.241091e-08
      5 Linear |R| = 1.056099e-08
      6 Linear |R| = 2.925392e-09
      7 Linear |R| = 5.487313e-10

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   PID 2525542 RUNNING AT pwmoose-PowerEdge-T640
=   EXIT CODE: 9
=   CLEANING UP REMAINING PROCESSES
=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

I believe this happens because:

  • BoundingValueNodalDamper evaluates nodal increments on all nodes,
  • but nodes in Block 2 do not own DOFs for theta_m,
  • so the damper accesses invalid memory.

When I try:

block = 'electrode'

the parser reports:

ERROR: unused parameter 'Dampers/limit_theta_m/block'

so the standard damper apparently does not support block restriction.


❓ My questions

  1. Is there a recommended way to apply a NodalDamper only on nodes belonging to a specific block? (i.e., only where the variable actually exists)

  2. or should I implement a custom damper derived from BoundingValueNodalDamper?


🙏 Any suggestions or guidance would be greatly appreciated.

Best regards, Wei Peng

GiudGiud avatar Dec 08 '25 20:12 GiudGiud