forked from idaholab/falcon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
27 changed files
with
1,144 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
[submodule "moose"] | ||
path = moose | ||
url = https://github.com/idaholab/moose.git | ||
[submodule "iapws95"] | ||
path = iapws95 | ||
url = [email protected]:idaholab/iapws95.git | ||
update = none |
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
Submodule iapws95
added at
208297
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,28 @@ | ||
#pragma once | ||
|
||
#include "Closures1PhaseBase.h" | ||
|
||
/** | ||
* Single-phase closures for tube geometry based on TRACE v5 | ||
*/ | ||
class Closures1PhaseFalcon : public Closures1PhaseBase | ||
{ | ||
public: | ||
Closures1PhaseFalcon(const InputParameters & params); | ||
|
||
virtual void checkFlowChannel(const FlowChannelBase & flow_channel) const override; | ||
virtual void checkHeatTransfer(const HeatTransferBase & heat_transfer, const FlowChannelBase & flow_channel) const override; | ||
virtual void addMooseObjectsFlowChannel(const FlowChannelBase & flow_channel) override; | ||
virtual void addMooseObjectsHeatTransfer(const HeatTransferBase & heat_transfer, const FlowChannelBase & flow_channel) override; | ||
|
||
protected: | ||
/** | ||
* Adds material that computes wall friction factor using Churchill correlation | ||
* | ||
* @param[in] flow_channel Flow channel component | ||
*/ | ||
void addWallFrictionChurchillMaterial(const FlowChannel1Phase & flow_channel) const; | ||
|
||
public: | ||
static InputParameters validParams(); | ||
}; |
52 changes: 52 additions & 0 deletions
52
include/materials/ADWallHeatTransferCoefficient3EqnMaterial.h
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,52 @@ | ||
#pragma once | ||
|
||
#include "Material.h" | ||
#include "FlowChannelBase.h" | ||
|
||
class SinglePhaseFluidProperties; | ||
|
||
/** | ||
* Computes liquid wall heat transfer coefficient for pipe geometry using TRACE closures | ||
*/ | ||
class ADWallHeatTransferCoefficient3EqnMaterial : public Material | ||
{ | ||
public: | ||
ADWallHeatTransferCoefficient3EqnMaterial(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual void computeQpProperties(); | ||
|
||
/// Wall heat transfer coefficient | ||
ADMaterialProperty<Real> & _Hw; | ||
/// Fluid density | ||
const ADMaterialProperty<Real> & _rho; | ||
/// Fluid velocity | ||
const ADMaterialProperty<Real> & _vel; | ||
/// Hydraulic diameter | ||
const ADMaterialProperty<Real> & _D_h; | ||
/// Specific volume | ||
const ADMaterialProperty<Real> & _v; | ||
/// Specific internal energy | ||
const ADMaterialProperty<Real> & _e; | ||
/// Fluid temperature | ||
const ADMaterialProperty<Real> & _T; | ||
/// Wall temperature | ||
const ADMaterialProperty<Real> & _T_wall; | ||
/// Pressure of the fluid | ||
const ADMaterialProperty<Real> & _p; | ||
/// Reynolds number | ||
const ADMaterialProperty<Real> & _Re; | ||
/// Prandtl number | ||
const ADMaterialProperty<Real> & _Pr; | ||
/// Thermal conductivity of the fluid | ||
const ADMaterialProperty<Real> & _k; | ||
/// Dynamic viscosity of the fluid | ||
const ADMaterialProperty<Real> & _mu; | ||
/// Gravitational acceleration magnitude | ||
const Real & _gravity_magnitude; | ||
/// Fluid properties | ||
const SinglePhaseFluidProperties & _fp; | ||
|
||
public: | ||
static InputParameters validParams(); | ||
}; |
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,153 @@ | ||
#include "Closures1PhaseFalcon.h" | ||
#include "FlowModelSinglePhase.h" | ||
#include "FlowChannel1Phase.h" | ||
#include "HeatTransfer1PhaseBase.h" | ||
|
||
registerMooseObject("FalconApp", Closures1PhaseFalcon); | ||
|
||
InputParameters | ||
Closures1PhaseFalcon::validParams() | ||
{ | ||
InputParameters params = Closures1PhaseBase::validParams(); | ||
|
||
params.addClassDescription("Single-phase closures for tube geometry based on TRACE v5"); | ||
|
||
return params; | ||
} | ||
|
||
Closures1PhaseFalcon::Closures1PhaseFalcon(const InputParameters & params) | ||
: Closures1PhaseBase(params) | ||
{ | ||
} | ||
|
||
void | ||
Closures1PhaseFalcon::checkFlowChannel(const FlowChannelBase & flow_channel) const | ||
{ | ||
if (MooseUtils::absoluteFuzzyEqual(flow_channel.getGravityMagnitude(), 0.0)) | ||
logComponentError(flow_channel.cname(), "Falcon closures assume non-zero gravity."); | ||
|
||
if (flow_channel.getNumberOfHeatTransferConnections() > 0) | ||
{ | ||
if (!flow_channel.getTemperatureMode()) | ||
logComponentError(flow_channel.cname(), | ||
"Heat transfer from heat flux is currently not available. Please, contact " | ||
"developers if you have a need for it."); | ||
} | ||
} | ||
|
||
void | ||
Closures1PhaseFalcon::checkHeatTransfer(const HeatTransferBase & /*heat_transfer*/, | ||
const FlowChannelBase & /*flow_channel*/) const | ||
{ | ||
} | ||
|
||
void | ||
Closures1PhaseFalcon::addMooseObjectsFlowChannel(const FlowChannelBase & flow_channel) | ||
{ | ||
const FlowChannel1Phase & flow_channel_1phase = | ||
dynamic_cast<const FlowChannel1Phase &>(flow_channel); | ||
|
||
// wall friction material | ||
if (flow_channel.isParamValid("f")) | ||
addWallFrictionFunctionMaterial(flow_channel_1phase); | ||
else | ||
addWallFrictionChurchillMaterial(flow_channel_1phase); | ||
|
||
const unsigned int n_ht_connections = flow_channel_1phase.getNumberOfHeatTransferConnections(); | ||
if (n_ht_connections > 0) | ||
{ | ||
if (n_ht_connections > 1) | ||
addAverageWallTemperatureMaterial(flow_channel_1phase); | ||
else | ||
addWallTemperatureFromAuxMaterial(flow_channel_1phase); | ||
} | ||
} | ||
|
||
void | ||
Closures1PhaseFalcon::addMooseObjectsHeatTransfer(const HeatTransferBase & heat_transfer, | ||
const FlowChannelBase & flow_channel) | ||
{ | ||
const HeatTransfer1PhaseBase & heat_transfer_1phase = | ||
dynamic_cast<const HeatTransfer1PhaseBase &>(heat_transfer); | ||
|
||
if (heat_transfer.isParamValid("Hw")) | ||
{ | ||
const FunctionName & Hw_fn_name = heat_transfer.getParam<FunctionName>("Hw"); | ||
|
||
const std::string class_name = "ADGenericFunctionMaterial"; | ||
InputParameters params = _factory.getValidParams(class_name); | ||
params.set<std::vector<SubdomainName>>("block") = flow_channel.getSubdomainNames(); | ||
params.set<std::vector<std::string>>("prop_names") = { | ||
heat_transfer_1phase.getWallHeatTransferCoefficient1PhaseName()}; | ||
params.set<std::vector<FunctionName>>("prop_values") = {Hw_fn_name}; | ||
_sim.addMaterial(class_name, genName(heat_transfer.name(), "Hw_material"), params); | ||
|
||
heat_transfer.makeFunctionControllableIfConstant(Hw_fn_name, "Hw"); | ||
} | ||
else | ||
{ | ||
const FlowChannel1Phase & flow_channel_1phase = | ||
_sim.getComponentByName<FlowChannel1Phase>(heat_transfer_1phase.getFlowChannelName()); | ||
{ | ||
const std::string class_name = "ADReynoldsNumberMaterial"; | ||
InputParameters params = _factory.getValidParams(class_name); | ||
params.set<std::vector<SubdomainName>>("block") = | ||
heat_transfer_1phase.getFlowChannelSubdomains(); | ||
params.set<MaterialPropertyName>("D_h") = FlowModelSinglePhase::HYDRAULIC_DIAMETER; | ||
params.set<MaterialPropertyName>("rho") = FlowModelSinglePhase::DENSITY; | ||
params.set<MaterialPropertyName>("vel") = FlowModelSinglePhase::VELOCITY; | ||
params.set<MaterialPropertyName>("mu") = FlowModelSinglePhase::DYNAMIC_VISCOSITY; | ||
params.set<MaterialPropertyName>("Re") = FlowModelSinglePhase::REYNOLDS_NUMBER; | ||
_sim.addMaterial(class_name, genName(heat_transfer.name(), "reynolds_mat"), params); | ||
} | ||
{ | ||
const std::string class_name = "ADPrandtlNumberMaterial"; | ||
InputParameters params = _factory.getValidParams(class_name); | ||
params.set<std::vector<SubdomainName>>("block") = | ||
heat_transfer_1phase.getFlowChannelSubdomains(); | ||
params.set<MaterialPropertyName>("cp") = | ||
FlowModelSinglePhase::SPECIFIC_HEAT_CONSTANT_PRESSURE; | ||
params.set<MaterialPropertyName>("mu") = FlowModelSinglePhase::DYNAMIC_VISCOSITY; | ||
params.set<MaterialPropertyName>("k") = FlowModelSinglePhase::THERMAL_CONDUCTIVITY; | ||
_sim.addMaterial(class_name, genName(heat_transfer.name(), "prandtl_mat"), params); | ||
} | ||
{ | ||
const std::string class_name = "ADWallHeatTransferCoefficient3EqnMaterial"; | ||
InputParameters params = _factory.getValidParams(class_name); | ||
params.set<std::vector<SubdomainName>>("block") = | ||
heat_transfer_1phase.getFlowChannelSubdomains(); | ||
params.set<MaterialPropertyName>("D_h") = FlowModelSinglePhase::HYDRAULIC_DIAMETER; | ||
params.set<MaterialPropertyName>("rho") = FlowModelSinglePhase::DENSITY; | ||
params.set<MaterialPropertyName>("vel") = FlowModelSinglePhase::VELOCITY; | ||
params.set<MaterialPropertyName>("v") = FlowModelSinglePhase::SPECIFIC_VOLUME; | ||
params.set<MaterialPropertyName>("e") = FlowModelSinglePhase::SPECIFIC_INTERNAL_ENERGY; | ||
params.set<MaterialPropertyName>("T") = FlowModelSinglePhase::TEMPERATURE; | ||
params.set<MaterialPropertyName>("T_wall") = FlowModelSinglePhase::TEMPERATURE_WALL; | ||
params.set<MaterialPropertyName>("p") = FlowModelSinglePhase::PRESSURE; | ||
params.set<MaterialPropertyName>("Re") = FlowModelSinglePhase::REYNOLDS_NUMBER; | ||
params.set<MaterialPropertyName>("Pr") = "Pr"; | ||
params.set<MaterialPropertyName>("mu") = FlowModelSinglePhase::DYNAMIC_VISCOSITY; | ||
params.set<UserObjectName>("fp") = heat_transfer_1phase.getFluidPropertiesName(); | ||
params.set<Real>("gravity_magnitude") = flow_channel_1phase.getGravityMagnitude(); | ||
_sim.addMaterial(class_name, genName(heat_transfer.name(), "whtc_mat"), params); | ||
} | ||
} | ||
} | ||
|
||
void | ||
Closures1PhaseFalcon::addWallFrictionChurchillMaterial( | ||
const FlowChannel1Phase & flow_channel) const | ||
{ | ||
const std::string class_name = "ADWallFrictionChurchillMaterial"; | ||
InputParameters params = _factory.getValidParams(class_name); | ||
params.set<std::vector<SubdomainName>>("block") = flow_channel.getSubdomainNames(); | ||
params.set<MaterialPropertyName>("rho") = FlowModelSinglePhase::DENSITY; | ||
params.set<MaterialPropertyName>("vel") = FlowModelSinglePhase::VELOCITY; | ||
params.set<MaterialPropertyName>("D_h") = FlowModelSinglePhase::HYDRAULIC_DIAMETER; | ||
params.set<MaterialPropertyName>("f_D") = FlowModelSinglePhase::FRICTION_FACTOR_DARCY; | ||
params.set<MaterialPropertyName>("mu") = FlowModelSinglePhase::DYNAMIC_VISCOSITY; | ||
params.set<Real>("roughness") = flow_channel.getParam<Real>("roughness"); | ||
const std::string obj_name = genName(flow_channel.name(), "wall_friction_mat"); | ||
_sim.addMaterial(class_name, obj_name, params); | ||
flow_channel.connectObject(params, obj_name, "roughness"); | ||
} |
Oops, something went wrong.