Skip to content

Commit

Permalink
Rename transfer kernel idaholab#29484
Browse files Browse the repository at this point in the history
  • Loading branch information
kyriv1980 committed Oct 29, 2024
1 parent 5a93432 commit 9c125cf
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 63 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MultiAppUserObjectTransferSCM

!syntax description /Transfers/MultiAppUserObjectTransferSCM

## Example Input File Syntax

!listing /examples/coupling/HeatConduction_SC/main.i block=Transfers language=cpp

!syntax parameters /Transfers/MultiAppUserObjectTransferSCM

!syntax inputs /Transfers/MultiAppUserObjectTransferSCM

!syntax children /Transfers/MultiAppUserObjectTransferSCM
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,21 @@ pitch = 7.26e-3

[Transfers]
[Tpin] # send pin surface temperature to bison,
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
to_multi_app = sub
variable = Pin_surface_temperature
user_object = Tpin_avg_uo
[]

[diameter] # send diameter information from /BISON/heatConduction to subchannel
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = Dpin
user_object = pin_diameter_uo
[]

[q_prime] # send heat flux from /BISON/heatConduction to subchannel
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = q_prime
user_object = q_prime_uo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,21 @@ heated_length = 1.0

[Transfers]
[Tpin] # send pin surface temperature to bison,
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
to_multi_app = sub
variable = Pin_surface_temperature
user_object = Tpin_avg_uo
[]

[diameter] # send diameter information from /BISON/heatConduction to subchannel
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = Dpin
user_object = pin_diameter_uo
[]

[q_prime] # send heat flux from /BISON/heatConduction to subchannel
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = q_prime
user_object = q_prime_uo
Expand Down
12 changes: 6 additions & 6 deletions modules/subchannel/examples/coupling/BISON_SC/main.i
Original file line number Diff line number Diff line change
Expand Up @@ -296,44 +296,44 @@ pitch = 0.0126

[Transfers]
[Tpin] # send pin surface temperature to bison,
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
to_multi_app = sub
variable = Pin_surface_temperature
user_object = Tpin_avg_uo
[]

[q_prime]
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = q_prime
user_object = q_prime_uo
execute_on = 'timestep_end'
[]

# [Tpin1] # send pin surface temperature to bison,
# type = MultiAppUserObjectTransfer2
# type = MultiAppUserObjectTransferSCM
# to_multi_app = sub1
# variable = Pin_surface_temperature
# user_object = Tpin_avg_uo
# []
#
# [Tpin2] # send pin surface temperature to bison,
# type = MultiAppUserObjectTransfer2
# type = MultiAppUserObjectTransferSCM
# to_multi_app = sub2
# variable = Pin_surface_temperature
# user_object = Tpin_avg_uo
# []
#
# [q_prime1] # send heat flux from BISON/heatConduction to subchannel
# type = MultiAppUserObjectTransfer2
# type = MultiAppUserObjectTransferSCM
# from_multi_app = sub1
# variable = q_prime
# user_object = q_prime_uo
# execute_on = 'timestep_end'
# []
#
# [q_prime2] # send heat flux from BISON/heatConduction to subchannel
# type = MultiAppUserObjectTransfer2
# type = MultiAppUserObjectTransferSCM
# from_multi_app = sub2
# variable = q_prime
# user_object = q_prime_uo
Expand Down
4 changes: 2 additions & 2 deletions modules/subchannel/examples/coupling/HeatConduction_SC/main.i
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,14 @@ heated_length = 1.0 # m

[Transfers]
[Tpin] # send pin surface temperature to bison,
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
to_multi_app = sub
variable = Pin_surface_temperature
user_object = Tpin_avg_uo
[]

[q_prime] # send heat flux from BISON/heatConduction to subchannel
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = q_prime
user_object = q_prime_uo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "MultiAppConservativeTransfer.h"

class MultiAppUserObjectTransfer2;
class MultiAppUserObjectTransferSCM;

/**
* This is a copy of MultiAppUserObjectTransfer, but swaps y-, and z- coordinate, so we can
Expand All @@ -26,12 +26,12 @@ class MultiAppUserObjectTransfer2;
*
* NOTE: This will need a better name before merging into devel
*/
class MultiAppUserObjectTransfer2 : public MultiAppConservativeTransfer
class MultiAppUserObjectTransferSCM : public MultiAppConservativeTransfer
{
public:
static InputParameters validParams();

MultiAppUserObjectTransfer2(const InputParameters & parameters);
MultiAppUserObjectTransferSCM(const InputParameters & parameters);

virtual void execute() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/* See COPYRIGHT for full restrictions */
/********************************************************************/

#include "MultiAppUserObjectTransfer2.h"
#include "MultiAppUserObjectTransferSCM.h"

#include <limits>

Expand All @@ -29,13 +29,13 @@
#include "libmesh/mesh_function.h"
#include "libmesh/mesh_tools.h"

registerMooseObject("SubChannelApp", MultiAppUserObjectTransfer2);
registerMooseObject("SubChannelApp", MultiAppUserObjectTransferSCM);

InputParameters
MultiAppUserObjectTransfer2::validParams()
MultiAppUserObjectTransferSCM::validParams()
{
InputParameters params = MultiAppConservativeTransfer::validParams();
// MultiAppUserObjectTransfer2 does not need source variable since it query values from user
// MultiAppUserObjectTransferSCM does not need source variable since it query values from user
// objects
params.suppressParameter<std::vector<VariableName>>("source_variable");
params.set<std::vector<VariableName>>("source_variable") = std::vector<VariableName>{};
Expand All @@ -61,20 +61,22 @@ MultiAppUserObjectTransfer2::validParams()
"parameter is used).");

params.addClassDescription(
"Samples a variable's value in the Master domain at the point where the MultiApp is and "
"copies that value into a post-processor in the MultiApp");
"Transfers a variable's value that has been sampled into a UserObject, in the "
"MainApp/MultiApp domain, into a post-processor or variable in the MultiApp/MainApp. "
"This is a copy of MultiAppUserObjectTransfer, but swaps y-, and z- coordinate, so we can "
"map the SCM solution that lives in a 3D mesh on a (2D) RZ-mesh of a heating pin.");

return params;
}

MultiAppUserObjectTransfer2::MultiAppUserObjectTransfer2(const InputParameters & parameters)
MultiAppUserObjectTransferSCM::MultiAppUserObjectTransferSCM(const InputParameters & parameters)
: MultiAppConservativeTransfer(parameters),
_user_object_name(getParam<UserObjectName>("user_object")),
_all_master_nodes_contained_in_sub_app(getParam<bool>("all_master_nodes_contained_in_sub_app")),
_skip_bbox_check(getParam<bool>("skip_bounding_box_check"))
{
// This transfer does not work with DistributedMesh
_fe_problem.mesh().errorIfDistributedMesh("MultiAppUserObjectTransfer2");
_fe_problem.mesh().errorIfDistributedMesh("MultiAppUserObjectTransferSCM");

if (_to_var_names.size() != 1)
paramError("variable", " Support single to-variable only ");
Expand All @@ -89,9 +91,9 @@ MultiAppUserObjectTransfer2::MultiAppUserObjectTransfer2(const InputParameters &
}

void
MultiAppUserObjectTransfer2::execute()
MultiAppUserObjectTransferSCM::execute()
{
_console << "Beginning MultiAppUserObjectTransfer2 " << name() << std::endl;
_console << "Beginning MultiAppUserObjectTransferSCM " << name() << std::endl;

switch (_current_direction)
{
Expand Down Expand Up @@ -244,7 +246,7 @@ MultiAppUserObjectTransfer2::execute()

// Only works with a serialized mesh to transfer to!
mooseAssert(to_sys.get_mesh().is_serial(),
"MultiAppUserObjectTransfer2 only works with ReplicatedMesh!");
"MultiAppUserObjectTransferSCM only works with ReplicatedMesh!");

unsigned int to_var_num = to_sys.variable_number(to_var.name());

Expand Down Expand Up @@ -316,14 +318,14 @@ MultiAppUserObjectTransfer2::execute()
if (node_found_in_sub_app == 0)
{
Point n = *node;
mooseError("MultiAppUserObjectTransfer2: Master node ",
mooseError("MultiAppUserObjectTransferSCM: Master node ",
n,
" not found within the bounding box of any of the sub applications.");
}
else if (node_found_in_sub_app > 1)
{
Point n = *node;
mooseError("MultiAppUserObjectTransfer2: Master node ",
mooseError("MultiAppUserObjectTransferSCM: Master node ",
n,
" found within the bounding box of two or more sub applications.");
}
Expand Down Expand Up @@ -383,14 +385,14 @@ MultiAppUserObjectTransfer2::execute()
}

if (elem_found_in_sub_app == 0)
mooseError("MultiAppUserObjectTransfer2: Master element with ",
mooseError("MultiAppUserObjectTransferSCM: Master element with ",
n_points > 1 ? "node" : "centroid",
" at ",
point,
" not found within the bounding box of any of the sub applications.");

else if (elem_found_in_sub_app > 1)
mooseError("MultiAppUserObjectTransfer2: Master element with ",
mooseError("MultiAppUserObjectTransferSCM: Master element with ",
n_points > 1 ? "node" : "centroid",
" at ",
point,
Expand Down Expand Up @@ -439,9 +441,10 @@ MultiAppUserObjectTransfer2::execute()
if (from_value == std::numeric_limits<Real>::infinity())
{
Point n = *node;
mooseError("MultiAppUserObjectTransfer2: Point corresponding to master node at (",
n,
") not found in the sub application.");
mooseError(
"MultiAppUserObjectTransferSCM: Point corresponding to master node at (",
n,
") not found in the sub application.");
}
to_solution->set(dof, from_value);
}
Expand Down Expand Up @@ -503,7 +506,7 @@ MultiAppUserObjectTransfer2::execute()

if (from_value == std::numeric_limits<Real>::infinity())
mooseError(
"MultiAppUserObjectTransfer2: Point corresponding to element's centroid (",
"MultiAppUserObjectTransferSCM: Point corresponding to element's centroid (",
point,
") not found in sub application.");

Expand All @@ -521,31 +524,31 @@ MultiAppUserObjectTransfer2::execute()
}
}

_console << "Finished MultiAppUserObjectTransfer2 " << name() << std::endl;
_console << "Finished MultiAppUserObjectTransferSCM " << name() << std::endl;

postExecute();
}

bool
MultiAppUserObjectTransfer2::blockRestricted() const
MultiAppUserObjectTransferSCM::blockRestricted() const
{
return !_blk_ids.empty();
}

bool
MultiAppUserObjectTransfer2::boundaryRestricted() const
MultiAppUserObjectTransferSCM::boundaryRestricted() const
{
return !_bnd_ids.empty();
}

bool
MultiAppUserObjectTransfer2::hasBlocks(const Elem * elem) const
MultiAppUserObjectTransferSCM::hasBlocks(const Elem * elem) const
{
return _blk_ids.find(elem->subdomain_id()) != _blk_ids.end();
}

bool
MultiAppUserObjectTransfer2::hasBlocks(const MooseMesh * mesh, const Node * node) const
MultiAppUserObjectTransferSCM::hasBlocks(const MooseMesh * mesh, const Node * node) const
{
const std::set<SubdomainID> & node_blk_ids = mesh->getNodeBlockIds(*node);
std::set<SubdomainID> u;
Expand All @@ -558,7 +561,7 @@ MultiAppUserObjectTransfer2::hasBlocks(const MooseMesh * mesh, const Node * node
}

bool
MultiAppUserObjectTransfer2::isBoundaryNode(const MooseMesh * mesh, const Node * node) const
MultiAppUserObjectTransferSCM::isBoundaryNode(const MooseMesh * mesh, const Node * node) const
{
for (auto & bid : _bnd_ids)
if (mesh->isBoundaryNode(node->id(), bid))
Expand All @@ -567,7 +570,7 @@ MultiAppUserObjectTransfer2::isBoundaryNode(const MooseMesh * mesh, const Node *
}

bool
MultiAppUserObjectTransfer2::isBoundaryElem(const MooseMesh * mesh, const Elem * elem) const
MultiAppUserObjectTransferSCM::isBoundaryElem(const MooseMesh * mesh, const Elem * elem) const
{
for (auto & bid : _bnd_ids)
if (mesh->isBoundaryElem(elem->id(), bid))
Expand All @@ -576,7 +579,7 @@ MultiAppUserObjectTransfer2::isBoundaryElem(const MooseMesh * mesh, const Elem *
}

BoundingBox
MultiAppUserObjectTransfer2::getBoundingBox(unsigned int app, bool displaced_mesh)
MultiAppUserObjectTransferSCM::getBoundingBox(unsigned int app, bool displaced_mesh)
{
FEProblemBase & fe_problem_base = _multi_app->appProblemBase(app);
MooseMesh & mesh = (displaced_mesh && fe_problem_base.getDisplacedProblem().get() != NULL)
Expand Down
4 changes: 2 additions & 2 deletions modules/subchannel/test/tests/problems/coupling/main.i
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ P_out = 101325 # Pa

[Transfers]
[Tpin] # send pin surface temperature to bison,
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
to_multi_app = sub
variable = Pin_surface_temperature
user_object = Tpin_avg_uo
[]

[from_SLAVE] # send heat flux from BISON to subchannel
type = MultiAppUserObjectTransfer2
type = MultiAppUserObjectTransferSCM
from_multi_app = sub
variable = q_prime
user_object = q_prime_uo
Expand Down
Loading

0 comments on commit 9c125cf

Please sign in to comment.