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.
Add nearest point side layered integral user object. Refs idaholab#18702
- Loading branch information
1 parent
33797fc
commit 0e269b8
Showing
6 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
framework/doc/content/source/userobject/NearestPointLayeredSideIntegral.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 @@ | ||
# NearestPointLayeredSideIntegral | ||
|
||
The domain is virtually divided into a number of subdomains according to the | ||
nearest points provided by users. And then the layered side integral | ||
is computed for the sides on each individual subdomain separately. | ||
|
||
!syntax description /UserObjects/NearestPointLayeredSideIntegral | ||
|
||
!syntax parameters /UserObjects/NearestPointLayeredSideIntegral | ||
|
||
!syntax inputs /UserObjects/NearestPointLayeredSideIntegral | ||
|
||
!syntax children /UserObjects/NearestPointLayeredSideIntegral | ||
|
||
!bibtex bibliography |
37 changes: 37 additions & 0 deletions
37
framework/include/userobject/NearestPointLayeredSideIntegral.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,37 @@ | ||
//* 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 "LayeredSideIntegral.h" | ||
|
||
// Forward Declarations | ||
class NearestPointLayeredSideIntegral; | ||
|
||
template <> | ||
InputParameters validParams<NearestPointLayeredSideIntegral>(); | ||
|
||
/** | ||
* This UserObject computes integrals of a variable 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 integral | ||
* closest to each one of those points. | ||
*/ | ||
class NearestPointLayeredSideIntegral | ||
: public NearestPointBase<LayeredSideIntegral, SideIntegralVariableUserObject> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
NearestPointLayeredSideIntegral(const InputParameters & parameters); | ||
}; |
32 changes: 32 additions & 0 deletions
32
framework/src/userobject/NearestPointLayeredSideIntegral.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,32 @@ | ||
//* 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 | ||
|
||
// MOOSE includes | ||
#include "NearestPointLayeredSideIntegral.h" | ||
#include "LayeredSideIntegral.h" | ||
|
||
registerMooseObject("MooseApp", NearestPointLayeredSideIntegral); | ||
|
||
defineLegacyParams(NearestPointLayeredSideIntegral); | ||
|
||
InputParameters | ||
NearestPointLayeredSideIntegral::validParams() | ||
{ | ||
InputParameters params = | ||
nearestPointBaseValidParams<LayeredSideIntegral, SideIntegralVariableUserObject>(); | ||
|
||
params.addClassDescription("Compute layered side integrals for nearest-point based subdomains"); | ||
|
||
return params; | ||
} | ||
|
||
NearestPointLayeredSideIntegral::NearestPointLayeredSideIntegral(const InputParameters & parameters) | ||
: NearestPointBase<LayeredSideIntegral, SideIntegralVariableUserObject>(parameters) | ||
{ | ||
} |
Binary file added
BIN
+169 KB
...bjects/nearest_point_layered_side_integral/gold/nearest_point_layered_side_integral_out.e
Binary file not shown.
99 changes: 99 additions & 0 deletions
99
...sts/userobjects/nearest_point_layered_side_integral/nearest_point_layered_side_integral.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,99 @@ | ||
# This input computes both a layered average and layered integral with the | ||
# same direction, points, and number of layers. The layered integral for "bin" | ||
# i is directly equal to the layered average for "bin" i multiplied by | ||
# by 0.05 (side length of 1 divided by 10 layers X side length of 1 divided by 2 points). | ||
|
||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 3 | ||
nx = 10 | ||
ny = 10 | ||
nz = 10 | ||
[] | ||
|
||
[Variables] | ||
[dummy] | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[diffusion] | ||
type = Diffusion | ||
variable = dummy | ||
[] | ||
[] | ||
|
||
[AuxVariables] | ||
[u] | ||
[] | ||
[] | ||
|
||
[AuxVariables] | ||
[np_layered_integral] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[] | ||
[np_layered_average] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[] | ||
[] | ||
|
||
[AuxKernels] | ||
[u] | ||
type = FunctionAux | ||
variable = u | ||
function = u | ||
[] | ||
[np_layered_integral] | ||
type = SpatialUserObjectAux | ||
variable = np_layered_integral | ||
user_object = npli | ||
boundary = 'front' | ||
execute_on = timestep_end | ||
[] | ||
[np_layered_average] | ||
type = SpatialUserObjectAux | ||
variable = np_layered_average | ||
user_object = npla | ||
boundary = 'front' | ||
execute_on = timestep_end | ||
[] | ||
[] | ||
|
||
[Functions] | ||
[u] | ||
type = ParsedFunction | ||
value = 'x+2*y+3*z' | ||
[] | ||
[] | ||
|
||
[UserObjects] | ||
[npla] | ||
type = NearestPointLayeredSideAverage | ||
direction = x | ||
points = '0.5 0.25 0.5 | ||
0.5 0.75 0.5' | ||
num_layers = 10 | ||
variable = u | ||
boundary = 'front' | ||
[] | ||
[npli] | ||
type = NearestPointLayeredSideIntegral | ||
direction = x | ||
points = '0.5 0.25 0.5 | ||
0.5 0.75 0.5' | ||
num_layers = 10 | ||
variable = u | ||
boundary = 'front' | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
[] | ||
|
||
[Outputs] | ||
exodus = true | ||
hide = 'dummy' | ||
[] |
10 changes: 10 additions & 0 deletions
10
test/tests/userobjects/nearest_point_layered_side_integral/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_integral.i | ||
exodiff = nearest_point_layered_side_integral_out.e | ||
requirement = 'The system shall compute layered side integrals that computed from the closest values for a list of points' | ||
design = 'NearestPointLayeredSideIntegral.md' | ||
issues = '#18702' | ||
[../] | ||
[] |