-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from aurora-multiphysics/hsaunders1904/flow_ov…
…er_heated_plate Implement flow over heated plate example/test
- Loading branch information
Showing
153 changed files
with
38,262 additions
and
27,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <AuxKernel.h> | ||
#include <MooseTypes.h> | ||
|
||
/** | ||
* Auxiliary kernel to calculate the heat flux at the given boundaries. | ||
*/ | ||
class HeatFluxAux : public AuxKernel | ||
{ | ||
public: | ||
HeatFluxAux(const InputParameters & params); | ||
|
||
static InputParameters validParams(); | ||
|
||
/** | ||
* Compute the heat flux at the given quadrature point. | ||
* | ||
* Computes q = -s * k * ∇T, where 's' is a scale factor, k is the thermal conductivity, and T | ||
* is temperature. | ||
* | ||
* Note that we are assuming the thermal conductivity is equal at every quadrature point on the | ||
* given boundary. | ||
*/ | ||
Real computeValue(); | ||
|
||
private: | ||
VariableGradient const & _grad; | ||
Real const _thermal_conductivity{0.0}; | ||
MooseArray<Point> const & _normals; | ||
unsigned const _dim{0}; | ||
Real const _scale{1.0}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "HeatFluxAux.h" | ||
|
||
#include <Assembly.h> | ||
#include <MooseError.h> | ||
|
||
registerMooseObject("hippoApp", HeatFluxAux); | ||
|
||
namespace | ||
{ | ||
inline Real | ||
dot_product(const int n_dimensions, const Point & X, const Point & Y) | ||
{ | ||
Real tot = 0.0; | ||
for (int i = 0; i < n_dimensions; ++i) | ||
{ | ||
tot += X(i) * Y(i); | ||
} | ||
return tot; | ||
} | ||
} | ||
|
||
InputParameters | ||
HeatFluxAux::validParams() | ||
{ | ||
InputParameters params = AuxKernel::validParams(); | ||
params.addRequiredCoupledVar("T", "Temperature field"); | ||
params.addRequiredParam<Real>("thermal_conductivity", "Thermal Conductivity of material"); | ||
params.addParam<Real>("scale", 1.0, "Scaling factor for heat flux"); | ||
// Heat flux can only be calculated on a boundary. | ||
params.makeParamRequired<std::vector<BoundaryName>>("boundary"); | ||
return params; | ||
} | ||
|
||
HeatFluxAux::HeatFluxAux(const InputParameters & params) | ||
: AuxKernel(params), | ||
_grad{coupledGradient("T")}, | ||
_thermal_conductivity{getParam<Real>("thermal_conductivity")}, | ||
_normals{_assembly.normals()}, | ||
_dim{_mesh.dimension()}, | ||
_scale{getParam<Real>("scale")} | ||
{ | ||
mooseAssert(0 < _dim && _dim <= 3, "Dimension should be 1, 2 or 3"); | ||
} | ||
|
||
Real | ||
HeatFluxAux::computeValue() | ||
{ | ||
mooseAssert(_qp < _grad.size(), "Cannot index _grad with _qp"); | ||
mooseAssert(_qp < _normals.size(), "Cannot index _normals with _qp"); | ||
return -dot_product(_dim, _grad[_qp], _normals[_qp]) * _thermal_conductivity * _scale; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.