forked from idaholab/moose
-
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.
Added NearestPointLayeredSideAverage
It works now Refs idaholab#13252
- Loading branch information
Showing
6 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
framework/include/userobject/NearestPointLayeredSideAverage.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,38 @@ | ||
//* 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 | ||
|
||
#ifndef NEARESTPOINTLAYEREDSIDEAVERAGE_H | ||
#define NEARESTPOINTLAYEREDSIDEAVERAGE_H | ||
|
||
// MOOSE includes | ||
#include "SideIntegralVariableUserObject.h" | ||
#include "NearestPointBase.h" | ||
#include "LayeredSideAverage.h" | ||
|
||
// Forward Declarations | ||
class NearestPointLayeredSideAverage; | ||
|
||
template <> | ||
InputParameters validParams<NearestPointLayeredSideAverage>(); | ||
|
||
/** | ||
* This UserObject computes averages 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 average | ||
* closest to each one of those points. | ||
*/ | ||
class NearestPointLayeredSideAverage | ||
: public NearestPointBase<LayeredSideAverage, SideIntegralVariableUserObject> | ||
{ | ||
public: | ||
NearestPointLayeredSideAverage(const InputParameters & parameters); | ||
}; | ||
|
||
#endif |
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,29 @@ | ||
//* 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 "NearestPointLayeredSideAverage.h" | ||
#include "LayeredSideAverage.h" | ||
|
||
registerMooseObject("MooseApp", NearestPointLayeredSideAverage); | ||
|
||
template <> | ||
InputParameters | ||
validParams<NearestPointLayeredSideAverage>() | ||
{ | ||
InputParameters params = | ||
nearestPointBaseValidParams<LayeredSideAverage, SideIntegralVariableUserObject>(); | ||
|
||
return params; | ||
} | ||
|
||
NearestPointLayeredSideAverage::NearestPointLayeredSideAverage(const InputParameters & parameters) | ||
: NearestPointBase<LayeredSideAverage, SideIntegralVariableUserObject>(parameters) | ||
{ | ||
} |
Binary file added
BIN
+465 KB
...robjects/nearest_point_layered_side_average/gold/nearest_point_layered_side_average_out.e
Binary file not shown.
78 changes: 78 additions & 0 deletions
78
...tests/userobjects/nearest_point_layered_side_average/nearest_point_layered_side_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,78 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 3 | ||
nx = 40 | ||
ny = 10 | ||
nz = 10 | ||
[] | ||
|
||
[Variables] | ||
[./u] | ||
[../] | ||
[] | ||
|
||
[AuxVariables] | ||
[./np_layered_average] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[../] | ||
[] | ||
|
||
[Kernels] | ||
[./diff] | ||
type = Diffusion | ||
variable = u | ||
[../] | ||
[] | ||
|
||
[AuxKernels] | ||
[./np_layered_average] | ||
type = SpatialUserObjectAux | ||
variable = np_layered_average | ||
execute_on = timestep_end | ||
user_object = npla | ||
boundary = 'bottom top' | ||
[../] | ||
[] | ||
|
||
[UserObjects] | ||
[./npla] | ||
type = NearestPointLayeredSideAverage | ||
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 | ||
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_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_average.i' | ||
exodiff = 'nearest_point_layered_side_average_out.e' | ||
requirement = 'The system shall compute layered side averages that computed from the closest values for a list of points' | ||
design = 'NearestPointLayeredSideAverage.md' | ||
issues = '#13252' | ||
[../] | ||
[] |