forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move NearestPointLayeredSideFluxAverage from SAM to MOOSE
closes #idaholab#21258
- Loading branch information
Showing
6 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
framework/doc/content/source/userobject/NearestPointLayeredSideFluxAverage.md
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,15 @@ | ||
# NearestPointLayeredSideFluxAverage | ||
|
||
The domain is virtually divided into a number of subdomains according to the | ||
nearest points provided by users. And then the layered side average flux | ||
is computed for the sides on each individual subdomain separately. | ||
|
||
!syntax description /UserObjects/NearestPointLayeredSideFluxAverage | ||
|
||
!syntax parameters /UserObjects/NearestPointLayeredSideFluxAverage | ||
|
||
!syntax inputs /UserObjects/NearestPointLayeredSideFluxAverage | ||
|
||
!syntax children /UserObjects/NearestPointLayeredSideFluxAverage | ||
|
||
!bibtex bibliography |
31 changes: 31 additions & 0 deletions
31
framework/include/userobject/NearestPointLayeredSideFluxAverage.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,31 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
// MOOSE includes | ||
#include "SideIntegralVariableUserObject.h" | ||
#include "NearestPointBase.h" | ||
#include "LayeredSideDiffusiveFluxAverage.h" | ||
|
||
/** | ||
* This UserObject computes averages of a variable's flux storing partial | ||
* sums for the specified number of intervals in a direction (x,y,z). | ||
* | ||
* Given a list of points this object computes the layered average flux | ||
* closest to each one of those points. | ||
*/ | ||
class NearestPointLayeredSideFluxAverage | ||
: public NearestPointBase<LayeredSideDiffusiveFluxAverage, SideIntegralVariableUserObject> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
NearestPointLayeredSideFluxAverage(const InputParameters & parameters); | ||
}; |
31 changes: 31 additions & 0 deletions
31
framework/src/userobject/NearestPointLayeredSideFluxAverage.C
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,31 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "NearestPointLayeredSideFluxAverage.h" | ||
#include "LayeredSideDiffusiveFluxAverage.h" | ||
|
||
registerMooseObject("MooseApp", NearestPointLayeredSideFluxAverage); | ||
|
||
InputParameters | ||
NearestPointLayeredSideFluxAverage::validParams() | ||
{ | ||
InputParameters params = NearestPointBase<LayeredSideDiffusiveFluxAverage, | ||
SideIntegralVariableUserObject>::validParams(); | ||
|
||
params.addClassDescription( | ||
"Compute layered side flux averages for nearest-point based subdomains"); | ||
|
||
return params; | ||
} | ||
|
||
NearestPointLayeredSideFluxAverage::NearestPointLayeredSideFluxAverage( | ||
const InputParameters & parameters) | ||
: NearestPointBase<LayeredSideDiffusiveFluxAverage, SideIntegralVariableUserObject>(parameters) | ||
{ | ||
} |
Binary file added
BIN
+475 KB
...earest_point_layered_side_flux_average/gold/nearest_point_layered_side_flux_average_out.e
Binary file not shown.
79 changes: 79 additions & 0 deletions
79
...objects/nearest_point_layered_side_flux_average/nearest_point_layered_side_flux_average.i
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,79 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 3 | ||
nx = 40 | ||
ny = 10 | ||
nz = 10 | ||
[] | ||
|
||
[Variables] | ||
[./u] | ||
[../] | ||
[] | ||
|
||
[AuxVariables] | ||
[./np_layered_flux_average] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[../] | ||
[] | ||
|
||
[Kernels] | ||
[./diff] | ||
type = Diffusion | ||
variable = u | ||
[../] | ||
[] | ||
|
||
[AuxKernels] | ||
[./np_layered_flux_average] | ||
type = SpatialUserObjectAux | ||
variable = np_layered_flux_average | ||
execute_on = timestep_end | ||
user_object = nplsfa | ||
boundary = 'bottom top' | ||
[../] | ||
[] | ||
|
||
[UserObjects] | ||
[./nplsfa] | ||
type = NearestPointLayeredSideFluxAverage | ||
direction = x | ||
points='0.25 0 0.25 0.75 0 0.25 0.25 0 0.75 0.75 0 0.75' | ||
num_layers = 10 | ||
variable = u | ||
diffusivity = 1.0 | ||
execute_on = linear | ||
boundary = 'bottom top' | ||
[../] | ||
[] | ||
|
||
[BCs] | ||
[./left] | ||
type = DirichletBC | ||
variable = u | ||
boundary = left | ||
value = 0 | ||
[../] | ||
[./one] | ||
type = DirichletBC | ||
variable = u | ||
boundary = 'right back top' | ||
value = 1 | ||
[../] | ||
[] | ||
|
||
|
||
|
||
[Executioner] | ||
type = Steady | ||
|
||
solve_type = 'PJFNK' | ||
|
||
petsc_options_iname = '-pc_type -pc_hypre_type' | ||
petsc_options_value = 'hypre boomeramg' | ||
[] | ||
|
||
[Outputs] | ||
exodus = true | ||
[] |
10 changes: 10 additions & 0 deletions
10
test/tests/userobjects/nearest_point_layered_side_flux_average/tests
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,10 @@ | ||
[Tests] | ||
[./test] | ||
type = 'Exodiff' | ||
input = 'nearest_point_layered_side_flux_average.i' | ||
exodiff = 'nearest_point_layered_side_flux_average_out.e' | ||
requirement = 'The system shall compute layered side flux averages that computed from the closest values for a list of points' | ||
design = 'NearestPointLayeredSideFluxAverage.md' | ||
issues = '#21258' | ||
[../] | ||
[] |