Skip to content

Commit

Permalink
Revised FVFunctorConvectiveHeatFluxBC test to include solid and fluid…
Browse files Browse the repository at this point in the history
… domain via multiapp, minor revisions (idaholab#21632)
  • Loading branch information
CooperTrucks authored and CooperTrucks committed Aug 4, 2022
1 parent 9d3a630 commit c84d75a
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# Description

This boundary condition computes convective heat flux $q'' = h \cdot (T - T_{inf})$, where $H$ is convective heat transfer coefficient,
$T$ is the temperature, and $T_{inf}$ is far field temperature. Both $H$ and $T_{inf}$ are coupled as functors.
This boundary condition computes convective heat flux $q'' = h \cdot (T - T_{bulk})$, where $H$ is convective heat transfer coefficient,
$T$ is the temperature, and $T_{bulk}$ is far field temperature. Both $H$ and $T_{bulk}$ are coupled as functors.
The domain of the variable can be specified as either a fluid or a solid using $is\_solid$. For a solid domain, the equation above is applied.
For a fluid domain, the negative of the heat flux is applied. This allows for easier implementation of a double Robin
boundary condition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class FVFunctorConvectiveHeatFluxBC : public FVFluxBC
virtual ADReal computeQpResidual() override;

/// Wall temperature functor
const Moose::Functor<ADReal> & _T_wall;
const Moose::Functor<ADReal> & _T_solid;

/// Far-field temperature functor
const Moose::Functor<ADReal> & _T_infinity;
const Moose::Functor<ADReal> & _T_bulk;

/// Convective heat transfer coefficient functor
const Moose::Functor<ADReal> & _htc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ FVFunctorConvectiveHeatFluxBC::validParams()
params.addClassDescription(
"Convective heat transfer boundary condition with temperature and heat "
"transfer coefficent given by functors.");
params.addRequiredParam<MooseFunctorName>("T_wall", "Functor for wall temperature");
params.addRequiredParam<MooseFunctorName>("T_infinity", "Functor for far-field temperature");
params.addRequiredParam<MooseFunctorName>("T_solid", "Functor for wall temperature");
params.addRequiredParam<MooseFunctorName>("T_bulk", "Functor for far-field temperature");
params.addRequiredParam<MooseFunctorName>("heat_transfer_coefficient",
"Functor for heat transfer coefficient");
params.addRequiredParam<bool>("is_solid", "Whether this kernel acts on the solid temperature");
Expand All @@ -30,8 +30,8 @@ FVFunctorConvectiveHeatFluxBC::validParams()

FVFunctorConvectiveHeatFluxBC::FVFunctorConvectiveHeatFluxBC(const InputParameters & parameters)
: FVFluxBC(parameters),
_T_wall(getFunctor<ADReal>("T_wall")),
_T_infinity(getFunctor<ADReal>("T_infinity")),
_T_solid(getFunctor<ADReal>("T_solid")),
_T_bulk(getFunctor<ADReal>("T_bulk")),
_htc(getFunctor<ADReal>("heat_transfer_coefficient")),
_is_solid(getParam<bool>("is_solid"))
{
Expand All @@ -42,8 +42,8 @@ FVFunctorConvectiveHeatFluxBC::computeQpResidual()
{
if (_is_solid)
return -_htc(singleSidedFaceArg()) *
(_T_infinity(singleSidedFaceArg()) - _T_wall(singleSidedFaceArg()));
(_T_bulk(singleSidedFaceArg()) - _T_solid(singleSidedFaceArg()));
else
return _htc(singleSidedFaceArg()) *
(_T_infinity(singleSidedFaceArg()) - _T_wall(singleSidedFaceArg()));
(_T_bulk(singleSidedFaceArg()) - _T_solid(singleSidedFaceArg()));
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,84 @@
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
nx = 6
ny = 5
xmax = 2
subdomain_ids = '0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1'
[]
[remove]
type = BlockDeletionGenerator
input = gen
block = 1
new_boundary = interface
[]
[]

[Variables]
[T_fluid]
[T_solid]
type = MooseVariableFVReal
initial_condition = 0
initial_condition = 1
[]
[]

[AuxVariables]
[T_wall]
[T_fluid]
type = MooseVariableFVReal
initial_condition = 1
[]
[]

[AuxKernels]
[wall_temp]
type = ConstantAux
variable = T_wall
value = 1
initial_condition = 0
[]
[]

[FVKernels]
[diff_left]
[diff_wall]
type = FVDiffusion
variable = T_fluid
coeff = 4
[]
[gradient_creating]
type = FVBodyForce
variable = T_fluid
variable = T_solid
block = 0
coeff = 2
[]
[]

[FVBCs]
[top]
[interface_fluid]
type = FVFunctorConvectiveHeatFluxBC
boundary = 'top'
variable = T_fluid
T_infinity = T_fluid
T_wall = T_wall
is_solid = false
boundary = 'interface'
variable = T_solid
T_bulk = T_fluid
T_solid = T_solid
is_solid = true
heat_transfer_coefficient = 'htc'
[]
[other]
[left]
type = FVDirichletBC
boundary = 'left'
variable = T_solid
value = 1
[]
[]

[MultiApps]
[interface_multiapp]
type = FullSolveMultiApp
input_files = 'fv_functor_convective_heat_flux_fluid.i'
execute_on = TIMESTEP_END
[]
[]

[Transfers]
[solid_transfer]
type = MultiAppNearestNodeTransfer
source_variable = T_solid
variable = T_solid
to_multi_app = interface_multiapp
[]
[fluid_transfer]
type = MultiAppNearestNodeTransfer
source_variable = T_fluid
variable = T_fluid
boundary = 'bottom'
value = 0
from_multi_app = interface_multiapp
[]
[]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 6
ny = 5
xmax = 2
subdomain_ids = '0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1'
[]

[remove]
type = BlockDeletionGenerator
input = gen
block = 0
new_boundary = interface
[]
[]

[Variables]
[T_fluid]
type = MooseVariableFVReal
initial_condition = 0
[]
[]

[AuxVariables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 0
[]
[]

[FVKernels]
[diff_fluid]
type = FVDiffusion
variable = T_fluid
block = 1
coeff = 4
[]
[gradient_creating]
type = FVBodyForce
variable = T_fluid
[]
[]

[FVBCs]
[interface_fluid]
type = FVFunctorConvectiveHeatFluxBC
boundary = 'interface'
variable = T_fluid
T_bulk = T_fluid
T_solid = T_solid
is_solid = false
heat_transfer_coefficient = 'htc'
[]
[left]
type = FVDirichletBC
boundary = 'right'
variable = T_fluid
value = 0
[]
[]

[Materials]
[cht]
type = ADGenericFunctorMaterial
prop_names = 'htc'
prop_values = '1'
[]
[]

[Executioner]
type = Steady
solve_type = NEWTON
[]

[Outputs]
exodus = true
[]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requirement = 'The system shall provide a convective heat flux boundary condition which uses functors as heat transfer coefficients and far-field temperature values'
type = Exodiff
input = fv_functor_convective_heat_flux.i
exodiff = 'fv_functor_convective_heat_flux_out.e'
exodiff = 'fv_functor_convective_heat_flux_out.e fv_functor_convective_heat_flux_out_interface_multiapp0.e'
ad_indexing_type = 'global'
[]
[]
3 changes: 2 additions & 1 deletion modules/navier_stokes/src/fvbcs/FVFunctorNeumannBC.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ InputParameters
FVFunctorNeumannBC::validParams()
{
InputParameters params = FVFluxBC::validParams();
params.addClassDescription("Neumann boundary condition for finite volume method.");
params.addClassDescription(
"Neumann boundary condition for finite volume method. Cannot be used for velocities.");
params.addParam<MooseFunctorName>("factor",
1.,
"A factor in the form of a functor for multiplying the "
Expand Down

0 comments on commit c84d75a

Please sign in to comment.