Cardinal
NekRSProblem.h
Go to the documentation of this file.
1 /********************************************************************/
2 /* SOFTWARE COPYRIGHT NOTIFICATION */
3 /* Cardinal */
4 /* */
5 /* (c) 2021 UChicago Argonne, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by UChicago Argonne, LLC */
9 /* Under Contract No. DE-AC02-06CH11357 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* Prepared by Battelle Energy Alliance, LLC */
13 /* Under Contract No. DE-AC07-05ID14517 */
14 /* With the U. S. Department of Energy */
15 /* */
16 /* See LICENSE for full restrictions */
17 /********************************************************************/
18 
19 #pragma once
20 
21 #include "NekRSProblemBase.h"
22 
41 {
42 public:
43  NekRSProblem(const InputParameters & params);
44 
45  static InputParameters validParams();
46 
56  ~NekRSProblem();
57 
65  virtual void initialSetup() override;
66 
69 
72 
75 
78 
81 
84 
89  virtual void adjustNekSolution() override;
90 
91  virtual void syncSolutions(ExternalProblem::Direction direction) override;
92 
93  virtual void addExternalVariables() override;
94 
99  virtual double maxInterpolatedTemperature() const;
100 
105  virtual double minInterpolatedTemperature() const;
106 
111  virtual const bool hasMovingNekMesh() const override { return nekrs::hasMovingMesh(); }
112 
113 protected:
122  bool normalizeHeatSource(const double moose_integral,
123  const double nek_integral,
124  double & normalized_nek_integral);
125 
132  void checkInitialFluxValues(const Real & nek_flux, const Real & moose_flux) const;
133 
134  virtual void addTemperatureVariable() override { return; }
135 
142  void calculateMeshVelocity(int e, const field::NekWriteEnum & field);
143 
145  const bool & _has_heat_source;
146 
155 
157  const Real & _abs_tol;
158 
160  const Real & _rel_tol;
161 
171  const PostprocessorValue * _flux_integral = nullptr;
172 
182  const VectorPostprocessorValue * _flux_integral_vpp = nullptr;
183 
193  const PostprocessorValue * _source_integral = nullptr;
194 
196  const PostprocessorValue * _min_T = nullptr;
197 
199  const PostprocessorValue * _max_T = nullptr;
200 
202  double * _T = nullptr;
203 
205  double * _flux_face = nullptr;
206 
208  double * _flux_elem = nullptr;
209 
211  double * _source_elem = nullptr;
212 
214  double * _displacement_x = nullptr;
215 
217  double * _displacement_y = nullptr;
218 
220  double * _displacement_z = nullptr;
221 
223  double * _mesh_velocity_elem = nullptr;
224 
226  unsigned int _temp_var;
227 
229  unsigned int _avg_flux_var;
230 
232  unsigned int _disp_x_var;
233 
235  unsigned int _disp_y_var;
236 
238  unsigned int _disp_z_var;
239 
241  unsigned int _heat_source_var;
242 };
NekRSProblem::sendVolumeDeformationToNek
void sendVolumeDeformationToNek()
Send volume mesh deformation flux to nekRS.
NekRSProblem::sendBoundaryDeformationToNek
void sendBoundaryDeformationToNek()
Send boundary deformation to nekRS.
NekRSProblem::_displacement_y
double * _displacement_y
displacement in y for all nodes from MOOSE, for moving mesh problems
Definition: NekRSProblem.h:217
NekRSProblem::getBoundaryTemperatureFromNek
void getBoundaryTemperatureFromNek()
Get boundary temperature from nekRS.
field::NekWriteEnum
NekWriteEnum
Enumeration of possible fields to write in nekRS.
Definition: CardinalEnums.h:104
NekRSProblem::hasMovingNekMesh
virtual const bool hasMovingNekMesh() const override
Definition: NekRSProblem.h:111
NekRSProblem::sendVolumeHeatSourceToNek
void sendVolumeHeatSourceToNek()
Send volume heat source to nekRS.
field
Definition: CardinalEnums.h:85
NekRSProblem::_avg_flux_var
unsigned int _avg_flux_var
flux transfer variable read from by nekRS
Definition: NekRSProblem.h:229
NekRSProblem::adjustNekSolution
virtual void adjustNekSolution() override
NekRSProblem::_has_heat_source
const bool & _has_heat_source
Whether a heat source will be applied to NekRS from MOOSE.
Definition: NekRSProblem.h:145
NekRSProblem::NekRSProblem
NekRSProblem(const InputParameters &params)
NekRSProblem::checkInitialFluxValues
void checkInitialFluxValues(const Real &nek_flux, const Real &moose_flux) const
NekRSProblem::calculateMeshVelocity
void calculateMeshVelocity(int e, const field::NekWriteEnum &field)
NekRSProblem::_mesh_velocity_elem
double * _mesh_velocity_elem
mesh velocity for a given element, used internally for calculating mesh velocity over one element
Definition: NekRSProblem.h:223
NekRSProblem::_flux_integral_vpp
const VectorPostprocessorValue * _flux_integral_vpp
Sideset-wise surface-integrated flux coming from the coupled MOOSE app.
Definition: NekRSProblem.h:182
NekRSProblem::_disp_x_var
unsigned int _disp_x_var
x-displacment transfer variable read for moving mesh problems
Definition: NekRSProblem.h:232
NekRSProblem::initialSetup
virtual void initialSetup() override
Perform some sanity checks on the problem setup.
NekRSProblem::_source_elem
double * _source_elem
MOOSE heat source interpolated onto the data transfer mesh.
Definition: NekRSProblem.h:211
NekRSProblem::_temp_var
unsigned int _temp_var
temperature transfer variable written to be nekRS
Definition: NekRSProblem.h:226
NekRSProblem::_displacement_z
double * _displacement_z
displacement in z for all nodes from MOOSE, for moving mesh problems
Definition: NekRSProblem.h:220
NekRSProblem::~NekRSProblem
~NekRSProblem()
Write nekRS's solution at the last output step.
NekRSProblem::_flux_face
double * _flux_face
MOOSE flux interpolated onto the (boundary) data transfer mesh.
Definition: NekRSProblem.h:205
NekRSProblem::_min_T
const PostprocessorValue * _min_T
Postprocessor to limit the minimum temperature.
Definition: NekRSProblem.h:196
NekRSProblem::sendBoundaryHeatFluxToNek
void sendBoundaryHeatFluxToNek()
Send boundary heat flux to nekRS.
NekRSProblem::syncSolutions
virtual void syncSolutions(ExternalProblem::Direction direction) override
NekRSProblem::addTemperatureVariable
virtual void addTemperatureVariable() override
Definition: NekRSProblem.h:134
NekRSProblem::_disp_y_var
unsigned int _disp_y_var
y-displacment transfer variable read for moving mesh problems
Definition: NekRSProblem.h:235
NekRSProblem::_abs_tol
const Real & _abs_tol
Absolute tolerance for checking flux/heat source normalizations.
Definition: NekRSProblem.h:157
NekRSProblem::_source_integral
const PostprocessorValue * _source_integral
Total volume-integrated heat source coming from the coupled MOOSE app.
Definition: NekRSProblem.h:193
nekrs::hasMovingMesh
bool hasMovingMesh()
NekRSProblem::getVolumeTemperatureFromNek
void getVolumeTemperatureFromNek()
Get volume temperature from nekRS.
NekRSProblem::addExternalVariables
virtual void addExternalVariables() override
NekRSProblem::validParams
static InputParameters validParams()
NekRSProblem::_flux_integral
const PostprocessorValue * _flux_integral
Total surface-integrated flux coming from the coupled MOOSE app.
Definition: NekRSProblem.h:171
NekRSProblem::_rel_tol
const Real & _rel_tol
Relative tolerance for checking flux/heat source normalizations.
Definition: NekRSProblem.h:160
NekRSProblem::minInterpolatedTemperature
virtual double minInterpolatedTemperature() const
NekRSProblemBase.h
NekRSProblem::_displacement_x
double * _displacement_x
displacement in x for all nodes from MOOSE, for moving mesh problems
Definition: NekRSProblem.h:214
NekRSProblem::_heat_source_var
unsigned int _heat_source_var
volumetric heat source variable read from by nekRS
Definition: NekRSProblem.h:241
NekRSProblem::_flux_elem
double * _flux_elem
MOOSE flux interpolated onto the (volume) data transfer mesh.
Definition: NekRSProblem.h:208
NekRSProblemBase
Definition: NekRSProblemBase.h:40
NekRSProblem::_T
double * _T
nekRS temperature interpolated onto the data transfer mesh
Definition: NekRSProblem.h:202
NekRSProblem::_conserve_flux_by_sideset
const bool & _conserve_flux_by_sideset
Definition: NekRSProblem.h:154
NekRSProblem::_disp_z_var
unsigned int _disp_z_var
z-displacment transfer variable read for moving mesh problems
Definition: NekRSProblem.h:238
NekRSProblem::maxInterpolatedTemperature
virtual double maxInterpolatedTemperature() const
NekRSProblem::_max_T
const PostprocessorValue * _max_T
Postprocessor to limit the maximum temperature.
Definition: NekRSProblem.h:199
NekRSProblem
Solve nekRS wrapped as a MOOSE app.
Definition: NekRSProblem.h:40
NekRSProblem::normalizeHeatSource
bool normalizeHeatSource(const double moose_integral, const double nek_integral, double &normalized_nek_integral)