Skip to content

Commit f57d6e3

Browse files
authored
Merge pull request #266 from smpark7/prec-function-vel
Fixes PrecursorAction with velocity functions, and supports higher order precursor variable initialization
2 parents 3882f3a + e73155a commit f57d6e3

32 files changed

+1027
-51
lines changed

include/actions/PrecursorAction.h

+16
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ class PrecursorAction : public VariableNotAMooseObjectAction
5151
*/
5252
void addTimeDerivative(const std::string & var_name);
5353

54+
/**
55+
* Adds appropriate conservative advection kernel
56+
*
57+
* @param var_name The name of the variable the kernel acts on
58+
*/
59+
void addAdvection(const std::string & var_name);
60+
5461
/**
5562
* Adds DGAdvection kernel
5663
*
@@ -72,6 +79,11 @@ class PrecursorAction : public VariableNotAMooseObjectAction
7279
*/
7380
void addInflowBC(const std::string & var_name);
7481

82+
/**
83+
* Adds a PostprocessorPenaltyDirichletBC to stabilize precursor conc at inlet
84+
*/
85+
void addPenaltyBC(const std::string & var_name);
86+
7587
/**
7688
* Adds random initial conditions for Jacobian testing
7789
*
@@ -127,5 +139,9 @@ class PrecursorAction : public VariableNotAMooseObjectAction
127139
/// optional object name suffix
128140
std::string _object_suffix;
129141

142+
/// whether input file is for the outer loop
130143
bool _is_loopapp;
144+
145+
/// velocity type
146+
MooseEnum _velocity_type;
131147
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
3+
#include "SideIntegralVariablePostprocessor.h"
4+
5+
/**
6+
* This postprocessor computes the weighted integral of a
7+
* variable along a boundary, weighted by the user-provided function.
8+
*/
9+
class SideFunctionWeightedIntegralPostprocessor : public SideIntegralVariablePostprocessor
10+
{
11+
public:
12+
SideFunctionWeightedIntegralPostprocessor(const InputParameters & parameters);
13+
14+
static InputParameters validParams();
15+
16+
protected:
17+
virtual Real computeQpIntegral() override;
18+
19+
// Weight function
20+
const Function & _weight_func;
21+
};

problems/2021-cnrs-benchmark/phase-0/nts.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
[pres]
4545
var_name_base = pre
4646
outlet_boundaries = ''
47-
constant_velocity_values = true
47+
velocity_type = constant
4848
u_def = 0
4949
v_def = 0
5050
w_def = 0

problems/2021-cnrs-benchmark/phase-0/tests

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Tests]
22
[vel_field_syntax]
33
type = RunApp
4-
input = nts.i
4+
input = vel-field.i
55
check_input = True
66
method = opt
77
[]
@@ -13,7 +13,7 @@
1313
[]
1414
[temperature_syntax]
1515
type = RunApp
16-
input = nts.i
16+
input = temperature.i
1717
check_input = True
1818
method = opt
1919
[]

problems/2021-cnrs-benchmark/phase-1/buoyancy-nts.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
[pres]
4343
var_name_base = pre
4444
outlet_boundaries = ''
45-
constant_velocity_values = false
45+
velocity_type = variable
4646
uvel = vel_x
4747
vvel = vel_y
4848
nt_exp_form = false

problems/2021-cnrs-benchmark/phase-1/circ-fuel.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
[pres]
4646
var_name_base = pre
4747
outlet_boundaries = ''
48-
constant_velocity_values = false
48+
velocity_type = variable
4949
uvel = ux
5050
vvel = uy
5151
nt_exp_form = false

problems/2021-cnrs-benchmark/phase-1/full-coupling-nts.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
[pres]
4343
var_name_base = pre
4444
outlet_boundaries = ''
45-
constant_velocity_values = false
45+
velocity_type = variable
4646
uvel = vel_x
4747
vvel = vel_y
4848
nt_exp_form = false

problems/2021-cnrs-benchmark/phase-1/power-coupling-nts.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
[pres]
4343
var_name_base = pre
4444
outlet_boundaries = ''
45-
constant_velocity_values = false
45+
velocity_type = variable
4646
uvel = ux
4747
vvel = uy
4848
nt_exp_form = false

problems/2021-cnrs-benchmark/phase-2/transient.i

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dt = 0.00625 # Timestep size = 1 / freq / 200 = 0.00625 s
4141

4242
[Problem]
4343
type = FEProblem
44+
allow_initial_conditions_with_restart = true
4445
[]
4546

4647
[Variables]
@@ -69,7 +70,7 @@ dt = 0.00625 # Timestep size = 1 / freq / 200 = 0.00625 s
6970
[pres]
7071
var_name_base = pre
7172
outlet_boundaries = ''
72-
constant_velocity_values = false
73+
velocity_type = variable
7374
uvel = velx
7475
vvel = vely
7576
nt_exp_form = false
@@ -214,7 +215,7 @@ dt = 0.00625 # Timestep size = 1 / freq / 200 = 0.00625 s
214215
[Functions]
215216
[func_alpha]
216217
type = ParsedFunction
217-
value = '1 + 0.1 * sin(2*pi*t*${freq})' # Perturbation frequency = 0.8Hz
218+
expression = '1 + 0.1 * sin(2*pi*t*${freq})' # Perturbation frequency = 0.8Hz
218219
[]
219220
[velxf]
220221
type = SolutionFunction

0 commit comments

Comments
 (0)