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

AuxKernel required for proper Postprocessor evaluations with ExternalProblem #17534

Closed
aprilnovak opened this issue Apr 7, 2021 · 1 comment · Fixed by #23091
Closed

AuxKernel required for proper Postprocessor evaluations with ExternalProblem #17534

aprilnovak opened this issue Apr 7, 2021 · 1 comment · Fixed by #23091
Assignees
Labels
C: Framework 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

@aprilnovak
Copy link
Contributor

aprilnovak commented Apr 7, 2021

Bug Description

When using the ExternalProblem interface, postprocessors of variables added via addExternalVariables and written in syncSolutions are lagged by one time step if the input file lacks any AuxKernels. For our OpenMC wrapping, our input files are quite slim, and don't have any AuxVariables or AuxKernels defined in the XML files. For the first time step, the lack of an AuxKernel is causing our ElementIntegralVariablePostprocessor of an external variable that we write to within syncSolutions to evaluate to 0.0, even though the variable is displayed correctly in the Exodus output and is nonzero.

Steps to Reproduce

I have attached a minimum working example with a very slimmed down BasicExternalProblem that creates a CONSTANT MONOMIAL variable heat_source and writes a value of 12345.0 to it within syncSolutions. If the input file looks like this:

[Mesh]
  type = GeneratedMesh
  dim = 2
[]

[Problem]
  type = BasicExternalProblem
[]

[AuxVariables]
  [dummy]
  []
[]

[Executioner]
  type = Transient
  num_steps = 1
[]

[Postprocessors]
  [heat_source]
    type = ElementIntegralVariablePostprocessor
    variable = heat_source
  []
[]

[Outputs]
  exodus = true
[]

then even if we are writing correctly to heat_source (and the Exodus file shows a heat source of 12345.0), the postprocessor evaluates to zero:

Time Step 1, time = 1, dt = 1
Transfer FROM app, setting value of 12345.0
 Solve Converged!

Postprocessor Values:
+----------------+----------------+
| time           | heat_source    |
+----------------+----------------+
|   0.000000e+00 |   0.000000e+00 |
|   1.000000e+00 |   0.000000e+00 |
+----------------+----------------+

However, if you just add a dummy AuxKernel that has nothing to do with the physics, i.e. adding this to the above file:

# Need to add this to see the evaluation of the heat source postprocessor
[AuxKernels]
  [dummy]
    type = ConstantAux
    variable = dummy
    value = 0.0
  []
[]

then the postprocessor evaluates correctly:

Time Step 1, time = 1, dt = 1
Transfer FROM app, setting value of 12345.0
 Solve Converged!

Postprocessor Values:
+----------------+----------------+
| time           | heat_source    |
+----------------+----------------+
|   0.000000e+00 |   0.000000e+00 |
|   1.000000e+00 |   1.234500e+04 |
+----------------+----------------+

If you increase num_steps, you'll see that the values are lagged by one time step for some reason.

What I think is the problem

So it seems that something needs to be fixed along the lines of:

The absence of auxkernels should not be what triggers when _u or coupledValue are evaluated (i.e. whatever Postprocessors grab) when using ExternalProblem. I made a FEProblem input (see test.i) that has kernel_coverage_check = false and skip_nl_system_check = true, and I did not see the same behavior - so it seems that this error is specific to ExternalProblem.

Impact

Annoyance - we can just add dummy AuxVariables and AuxKernels to all our inputs to get around this, but this is prone to errors for anyone who doesn't understand that dummy AuxKernels are needed to get correct problem output.

@aprilnovak aprilnovak added the T: defect An anomaly, which is anything that deviates from expectations. label Apr 7, 2021
@aprilnovak
Copy link
Contributor Author

aprilnovak commented Apr 7, 2021

example.zip

@aeslaughter aeslaughter added P: normal A defect affecting operation with a low possibility of significantly affects. C: Framework labels Apr 12, 2021
@GiudGiud GiudGiud added this to To do in FY22 NEAMS MP - User Oriented Enhancements via automation Apr 21, 2022
@lindsayad lindsayad self-assigned this Jan 3, 2023
lindsayad added a commit to lindsayad/moose that referenced this issue Jan 6, 2023
We cannot simply update the parallel solution. We have to do a second
step of localizing the parallel solution to the ghosted current local
solution

Closes idaholab#17534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework 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
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants