From 966c92f39a8884f7a988733d675500780d57a4bf Mon Sep 17 00:00:00 2001 From: Guillaume Giudicelli Date: Wed, 26 Jun 2024 15:07:39 -0600 Subject: [PATCH] Add support for FV variables for projection aux refs #22373 --- framework/include/auxkernels/ProjectionAux.h | 3 ++- framework/src/auxkernels/ProjectionAux.C | 2 +- test/tests/auxkernels/projection_aux/tests | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/include/auxkernels/ProjectionAux.h b/framework/include/auxkernels/ProjectionAux.h index 5c9c9d21b5e3..a9936f301ae9 100644 --- a/framework/include/auxkernels/ProjectionAux.h +++ b/framework/include/auxkernels/ProjectionAux.h @@ -33,7 +33,8 @@ class ProjectionAux : public AuxKernel const VariableValue & _v; /// A reference to the variable to project from - const MooseVariable & _source_variable; + /// We must use a field variable to support finite volume variables + const MooseVariableFieldBase & _source_variable; /// The system owning the source variable const System & _source_sys; diff --git a/framework/src/auxkernels/ProjectionAux.C b/framework/src/auxkernels/ProjectionAux.C index 23ccda850bcc..2a7f0b060f9f 100644 --- a/framework/src/auxkernels/ProjectionAux.C +++ b/framework/src/auxkernels/ProjectionAux.C @@ -43,7 +43,7 @@ ProjectionAux::validParams() ProjectionAux::ProjectionAux(const InputParameters & parameters) : AuxKernel(parameters), _v(coupledValue("v")), - _source_variable(*getVar("v", 0)), + _source_variable(*getFieldVar("v", 0)), _source_sys(_c_fe_problem.getSystem(coupledName("v"))) { // Output some messages to user diff --git a/test/tests/auxkernels/projection_aux/tests b/test/tests/auxkernels/projection_aux/tests index e85ee2e61740..8c45b1347fed 100644 --- a/test/tests/auxkernels/projection_aux/tests +++ b/test/tests/auxkernels/projection_aux/tests @@ -7,7 +7,7 @@ type = 'CSVDiff' input = '1d.i' csvdiff = '1d_constant.csv' - cli_args = 'Outputs/file_base=1d_constant' + cli_args = 'AuxVariables/base_elem/type=MooseVariableFVReal Outputs/file_base=1d_constant' detail = "a constant to all variable families supported in 1d at various orders," [] [1d_linear]