oomph::PressureAdvectionDiffusionValidation Namespace Reference

Functions

void wind_function (const Vector< double > &x, Vector< double > &wind)
 Wind. More...
 
void get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void get_exact_u (const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
double source_function (const Vector< double > &x_vect)
 Source function required to make the solution above an exact solution. More...
 

Variables

unsigned Flag = 0
 Flag for solution. More...
 
double Peclet = 0.0
 Peclet number – overwrite with actual Reynolds number. More...
 

Detailed Description

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Namespace for exact solution for pressure advection diffusion problem

Function Documentation

◆ get_exact_u() [1/2]

void oomph::PressureAdvectionDiffusionValidation::get_exact_u ( const Vector< double > &  x,
double u 
)

Exact solution as a scalar.

80  {
81  if (Flag == 0)
82  {
83  u = x[0] * x[0] * pow(1.0 - x[0], 2.0) * x[1] * x[1] *
84  pow(1.0 - x[1], 2.0);
85  }
86  else
87  {
88  u = 0.1E1 - Peclet * x[0] * (0.1E1 - 0.5 * x[0]);
89  }
90  }
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
unsigned Flag
Flag for solution.
Definition: navier_stokes_preconditioners.cc:42
double Peclet
Peclet number – overwrite with actual Reynolds number.
Definition: navier_stokes_preconditioners.cc:45
list x
Definition: plotDoE.py:28

References Flag, Peclet, Eigen::bfloat16_impl::pow(), and plotDoE::x.

◆ get_exact_u() [2/2]

void oomph::PressureAdvectionDiffusionValidation::get_exact_u ( const Vector< double > &  x,
Vector< double > &  u 
)

Exact solution as a Vector.

64  {
65  u.resize(3);
66  wind_function(x, u);
67  if (Flag == 0)
68  {
69  u[2] = x[0] * x[0] * pow(1.0 - x[0], 2.0) * x[1] * x[1] *
70  pow(1.0 - x[1], 2.0);
71  }
72  else
73  {
74  u[2] = 0.1E1 - Peclet * x[0] * (0.1E1 - 0.5 * x[0]);
75  }
76  }
void wind_function(const Vector< double > &x, Vector< double > &wind)
Wind.
Definition: navier_stokes_preconditioners.cc:48

References Flag, Peclet, Eigen::bfloat16_impl::pow(), wind_function(), and plotDoE::x.

Referenced by oomph::FpPressureAdvectionDiffusionProblem< ELEMENT >::doc_solution().

◆ source_function()

double oomph::PressureAdvectionDiffusionValidation::source_function ( const Vector< double > &  x_vect)

Source function required to make the solution above an exact solution.

94  {
95  double x[2];
96  x[0] = x_vect[0];
97  x[1] = x_vect[1];
98 
99 
100  double source = 0.0;
101 
102  if (Flag == 0)
103  {
104  source =
105  Peclet *
106  (sin(0.6E1 * x[1]) * (2.0 * x[0] * pow(1.0 - x[0], 2.0) * x[1] *
107  x[1] * pow(1.0 - x[1], 2.0) -
108  2.0 * x[0] * x[0] * (1.0 - x[0]) * x[1] *
109  x[1] * pow(1.0 - x[1], 2.0)) +
110  cos(0.6E1 * x[0]) * (2.0 * x[0] * x[0] * pow(1.0 - x[0], 2.0) *
111  x[1] * pow(1.0 - x[1], 2.0) -
112  2.0 * x[0] * x[0] * pow(1.0 - x[0], 2.0) *
113  x[1] * x[1] * (1.0 - x[1]))) -
114  2.0 * pow(1.0 - x[0], 2.0) * x[1] * x[1] * pow(1.0 - x[1], 2.0) +
115  8.0 * x[0] * (1.0 - x[0]) * x[1] * x[1] * pow(1.0 - x[1], 2.0) -
116  2.0 * x[0] * x[0] * x[1] * x[1] * pow(1.0 - x[1], 2.0) -
117  2.0 * x[0] * x[0] * pow(1.0 - x[0], 2.0) * pow(1.0 - x[1], 2.0) +
118  8.0 * x[0] * x[0] * pow(1.0 - x[0], 2.0) * x[1] * (1.0 - x[1]) -
119  2.0 * x[0] * x[0] * pow(1.0 - x[0], 2.0) * x[1] * x[1];
120  }
121  else
122  {
123  source = Peclet * (-0.1E1 * Peclet * (0.1E1 - 0.5 * x[0]) +
124  0.5 * Peclet * x[0]) -
125  0.1E1 * Peclet;
126  }
127 
128  return source;
129  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References cos(), Flag, Peclet, Eigen::bfloat16_impl::pow(), sin(), TestProblem::source(), and plotDoE::x.

Referenced by oomph::FpPressureAdvectionDiffusionProblem< ELEMENT >::validate().

◆ wind_function()

void oomph::PressureAdvectionDiffusionValidation::wind_function ( const Vector< double > &  x,
Vector< double > &  wind 
)

Wind.

49  {
50  if (Flag == 0)
51  {
52  wind[0] = sin(6.0 * x[1]);
53  wind[1] = cos(6.0 * x[0]);
54  }
55  else
56  {
57  wind[0] = 1.0;
58  wind[1] = 0.0;
59  }
60  }

References cos(), Flag, sin(), and plotDoE::x.

Referenced by get_exact_u(), and oomph::FpPressureAdvectionDiffusionProblem< ELEMENT >::pin_all_non_pressure_dofs().

Variable Documentation

◆ Flag

◆ Peclet

double oomph::PressureAdvectionDiffusionValidation::Peclet = 0.0

Peclet number – overwrite with actual Reynolds number.

Referenced by get_exact_u(), source_function(), and oomph::FpPressureAdvectionDiffusionProblem< ELEMENT >::validate().