Loading [MathJax]/extensions/tex2jax.js
Cardinal
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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{
42public:
43 NekRSProblem(const InputParameters & params);
44
45 static InputParameters validParams();
46
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
113protected:
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
143
145 const bool & _has_heat_source;
146
155
157 const Real & _abs_tol;
158
160 const Real & _rel_tol;
161
164
167
177 const PostprocessorValue * _flux_integral = nullptr;
178
188 const VectorPostprocessorValue * _flux_integral_vpp = nullptr;
189
199 const PostprocessorValue * _source_integral = nullptr;
200
202 const PostprocessorValue * _min_T = nullptr;
203
205 const PostprocessorValue * _max_T = nullptr;
206
208 double * _T = nullptr;
209
211 double * _flux_face = nullptr;
212
214 double * _flux_elem = nullptr;
215
217 double * _source_elem = nullptr;
218
220 double * _displacement_x = nullptr;
221
223 double * _displacement_y = nullptr;
224
226 double * _displacement_z = nullptr;
227
229 double * _mesh_velocity_elem = nullptr;
230
232 unsigned int _temp_var;
233
235 unsigned int _avg_flux_var;
236
238 unsigned int _disp_x_var;
239
241 unsigned int _disp_y_var;
242
244 unsigned int _disp_z_var;
245
247 unsigned int _heat_source_var;
248};
Definition NekRSProblemBase.h:41
Solve nekRS wrapped as a MOOSE app.
Definition NekRSProblem.h:41
static InputParameters validParams()
const Real & _rel_tol
Relative tolerance for checking flux/heat source normalizations.
Definition NekRSProblem.h:160
const bool & _conserve_flux_by_sideset
Definition NekRSProblem.h:154
const bool & _has_heat_source
Whether a heat source will be applied to NekRS from MOOSE.
Definition NekRSProblem.h:145
double * _displacement_x
displacement in x for all nodes from MOOSE, for moving mesh problems
Definition NekRSProblem.h:220
double * _T
nekRS temperature interpolated onto the data transfer mesh
Definition NekRSProblem.h:208
double * _mesh_velocity_elem
mesh velocity for a given element, used internally for calculating mesh velocity over one element
Definition NekRSProblem.h:229
const PostprocessorValue * _flux_integral
Total surface-integrated flux coming from the coupled MOOSE app.
Definition NekRSProblem.h:177
unsigned int _disp_z_var
z-displacment transfer variable read for moving mesh problems
Definition NekRSProblem.h:244
~NekRSProblem()
Write nekRS's solution at the last output step.
virtual void addExternalVariables() override
virtual void initialSetup() override
Perform some sanity checks on the problem setup.
unsigned int _disp_x_var
x-displacment transfer variable read for moving mesh problems
Definition NekRSProblem.h:238
void sendVolumeHeatSourceToNek()
Send volume heat source to nekRS.
virtual void addTemperatureVariable() override
Definition NekRSProblem.h:134
double * _displacement_y
displacement in y for all nodes from MOOSE, for moving mesh problems
Definition NekRSProblem.h:223
unsigned int _temp_var
temperature transfer variable written to be nekRS
Definition NekRSProblem.h:232
const PostprocessorValue * _source_integral
Total volume-integrated heat source coming from the coupled MOOSE app.
Definition NekRSProblem.h:199
void getVolumeTemperatureFromNek()
Get volume temperature from nekRS.
double * _displacement_z
displacement in z for all nodes from MOOSE, for moving mesh problems
Definition NekRSProblem.h:226
virtual void adjustNekSolution() override
void sendBoundaryHeatFluxToNek()
Send boundary heat flux to nekRS.
virtual void syncSolutions(ExternalProblem::Direction direction) override
unsigned int _heat_source_var
volumetric heat source variable read from by nekRS
Definition NekRSProblem.h:247
virtual const bool hasMovingNekMesh() const override
Definition NekRSProblem.h:111
unsigned int _disp_y_var
y-displacment transfer variable read for moving mesh problems
Definition NekRSProblem.h:241
const VectorPostprocessorValue * _flux_integral_vpp
Sideset-wise surface-integrated flux coming from the coupled MOOSE app.
Definition NekRSProblem.h:188
void sendVolumeDeformationToNek()
Send volume mesh deformation flux to nekRS.
double * _flux_elem
MOOSE flux interpolated onto the (volume) data transfer mesh.
Definition NekRSProblem.h:214
virtual double minInterpolatedTemperature() const
const Real & _initial_source_integral
Initial value to use for the total volumetric power for ensuring power conservation.
Definition NekRSProblem.h:166
double * _source_elem
MOOSE heat source interpolated onto the data transfer mesh.
Definition NekRSProblem.h:217
const Real & _initial_flux_integral
Initial value to use for the total boundary power for ensuring power conservation.
Definition NekRSProblem.h:163
bool normalizeHeatSource(const double moose_integral, const double nek_integral, double &normalized_nek_integral)
const PostprocessorValue * _max_T
Postprocessor to limit the maximum temperature.
Definition NekRSProblem.h:205
void calculateMeshVelocity(int e, const field::NekWriteEnum &field)
const Real & _abs_tol
Absolute tolerance for checking flux/heat source normalizations.
Definition NekRSProblem.h:157
unsigned int _avg_flux_var
flux transfer variable read from by nekRS
Definition NekRSProblem.h:235
void sendBoundaryDeformationToNek()
Send boundary deformation to nekRS.
void checkInitialFluxValues(const Real &nek_flux, const Real &moose_flux) const
double * _flux_face
MOOSE flux interpolated onto the (boundary) data transfer mesh.
Definition NekRSProblem.h:211
virtual double maxInterpolatedTemperature() const
const PostprocessorValue * _min_T
Postprocessor to limit the minimum temperature.
Definition NekRSProblem.h:202
void getBoundaryTemperatureFromNek()
Get boundary temperature from nekRS.
NekRSProblem(const InputParameters &params)
Definition CardinalEnums.h:89
NekWriteEnum
Enumeration of possible fields to write in nekRS.
Definition CardinalEnums.h:114
bool hasMovingMesh()