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.
Add a postprocessor to calculate the average value along the centerli…
…ne of an axisymmetric (RZ) mesh. Closes idaholab#7528.
- Loading branch information
Showing
8 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
framework/include/postprocessors/AxisymmetricCenterlineAverageValue.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,41 @@ | ||
/****************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ | ||
/* */ | ||
/* (c) 2010 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/****************************************************************/ | ||
|
||
#ifndef AXISYMMETRICCENTERLINEAVERAGEVALUE_H | ||
#define AXISYMMETRICCENTERLINEAVERAGEVALUE_H | ||
|
||
#include "SideAverageValue.h" | ||
|
||
//Forward Declarations | ||
class AxisymmetricCenterlineAverageValue; | ||
|
||
template<> | ||
InputParameters validParams<AxisymmetricCenterlineAverageValue>(); | ||
|
||
/** | ||
* This postprocessor computes a line integral of the specified variable | ||
* along the centerline of an axisymmetric domain. | ||
*/ | ||
class AxisymmetricCenterlineAverageValue : public SideAverageValue | ||
{ | ||
public: | ||
AxisymmetricCenterlineAverageValue(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual Real computeIntegral() override; | ||
virtual Real volume() override; | ||
Real _volume; | ||
}; | ||
|
||
#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
45 changes: 45 additions & 0 deletions
45
framework/src/postprocessors/AxisymmetricCenterlineAverageValue.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,45 @@ | ||
/****************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ | ||
/* */ | ||
/* (c) 2010 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/****************************************************************/ | ||
|
||
#include "AxisymmetricCenterlineAverageValue.h" | ||
// libmesh includes | ||
#include "libmesh/quadrature.h" | ||
|
||
template<> | ||
InputParameters validParams<AxisymmetricCenterlineAverageValue>() | ||
{ | ||
InputParameters params = validParams<SideAverageValue>(); | ||
return params; | ||
} | ||
|
||
AxisymmetricCenterlineAverageValue::AxisymmetricCenterlineAverageValue(const InputParameters & parameters) : | ||
SideAverageValue(parameters), | ||
_volume(0) | ||
{} | ||
|
||
Real | ||
AxisymmetricCenterlineAverageValue::volume() | ||
{ | ||
Real volume = _current_side_elem->volume(); | ||
return volume; | ||
} | ||
|
||
Real | ||
AxisymmetricCenterlineAverageValue::computeIntegral() | ||
{ | ||
Real sum = 0; | ||
for (_qp=0; _qp<_qrule->n_points(); _qp++) | ||
sum += _JxW[_qp]*computeQpIntegral(); | ||
return sum; | ||
} |
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
70 changes: 70 additions & 0 deletions
70
...essors/axisymmetric_centerline_average_value/axisymmetric_centerline_average_value_test.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,70 @@ | ||
[Problem] | ||
coord_type = RZ | ||
[] | ||
|
||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 2 | ||
nx = 10 | ||
ny = 10 | ||
xmin = 0 | ||
xmax = 2 | ||
ymin = 0 | ||
ymax = 1 | ||
[] | ||
|
||
[Variables] | ||
active = 'u' | ||
|
||
[./u] | ||
order = FIRST | ||
family = LAGRANGE | ||
[../] | ||
[] | ||
|
||
[Kernels] | ||
active = 'diff' | ||
|
||
[./diff] | ||
type = Diffusion | ||
variable = u | ||
[../] | ||
[] | ||
|
||
[BCs] | ||
active = 'top bottom' | ||
|
||
[./top] | ||
type = DirichletBC | ||
variable = u | ||
boundary = top | ||
value = 0 | ||
[../] | ||
|
||
[./bottom] | ||
type = DirichletBC | ||
variable = u | ||
boundary = bottom | ||
value = 1 | ||
[../] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
|
||
# Preconditioned JFNK (default) | ||
solve_type = 'PJFNK' | ||
[] | ||
|
||
[Postprocessors] | ||
[./average] | ||
type = AxisymmetricCenterlineAverageValue | ||
boundary = left | ||
variable = u | ||
[../] | ||
[] | ||
|
||
[Outputs] | ||
file_base = out | ||
exodus = true | ||
[] |
Binary file added
BIN
+27.8 KB
test/tests/postprocessors/axisymmetric_centerline_average_value/gold/out.e
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
test/tests/postprocessors/axisymmetric_centerline_average_value/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,7 @@ | ||
[Tests] | ||
[./test] | ||
type = 'Exodiff' | ||
input = 'axisymmetric_centerline_average_value_test.i' | ||
exodiff = 'out.e' | ||
[../] | ||
[] |