TanhSolnForUnsteadyHeat Namespace Reference

Functions

double step_position (const double &time)
 Position of step (x-axis intercept) More...
 
void get_exact_u (const double &time, const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void get_exact_u (const double &time, const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void get_source (const double &time, const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
void prescribed_flux_on_fixed_y_boundary (const double &time, const Vector< double > &x, double &flux)
 Flux required by the exact solution on a boundary on which y is fixed. More...
 

Variables

double Alpha
 Parameter for steepness of step. More...
 
double Beta
 Parameter for amplitude of step translation. More...
 
double Gamma
 Parameter for timescale of step translation. More...
 
double TanPhi
 Parameter for angle of step. More...
 

Detailed Description

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Namespace for exact solution of unsteady heat equation with sharp step

Function Documentation

◆ get_exact_u() [1/2]

void TanhSolnForUnsteadyHeat::get_exact_u ( const double time,
const Vector< double > &  x,
double u 
)

Exact solution as a scalar.

132  {
133  double X=x[0];
134  double Y=x[1];
135  u=tanh(0.1E1-Alpha*(TanPhi*(X-Beta*tanh(Gamma*cos(0.2E1*
136  MathematicalConstants::Pi*time)))-Y));
137  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
#define X
Definition: icosphere.cpp:20
double Pi
Definition: two_d_biharmonic.cc:235
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tanh(const bfloat16 &a)
Definition: BFloat16.h:639
double Alpha
Parameter for steepness of step.
Definition: optimisation/disable_ALE/unsteady_heat/two_d_unsteady_heat_adapt.cc:103
double Gamma
Parameter for timescale of step translation.
Definition: optimisation/disable_ALE/unsteady_heat/two_d_unsteady_heat_adapt.cc:109
double Beta
Parameter for amplitude of step translation.
Definition: optimisation/disable_ALE/unsteady_heat/two_d_unsteady_heat_adapt.cc:106
double TanPhi
Parameter for angle of step.
Definition: optimisation/disable_ALE/unsteady_heat/two_d_unsteady_heat_adapt.cc:112
list x
Definition: plotDoE.py:28
const char Y
Definition: test/EulerAngles.cpp:32

References Alpha, Beta, cos(), Gamma, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::tanh(), TanPhi, plotDoE::x, X, and Y.

◆ get_exact_u() [2/2]

void TanhSolnForUnsteadyHeat::get_exact_u ( const double time,
const Vector< double > &  x,
Vector< double > &  u 
)

Exact solution as a Vector.

123  {
124  double X=x[0];
125  double Y=x[1];
126  u[0]=tanh(0.1E1-Alpha*(TanPhi*(X-Beta*tanh(Gamma*cos(0.2E1*
127  MathematicalConstants::Pi*time)))-Y));
128  }

References Alpha, Beta, cos(), Gamma, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::tanh(), TanPhi, plotDoE::x, X, and Y.

Referenced by RefineableUnsteadyHeatProblem< ELEMENT >::doc_solution().

◆ get_source()

void TanhSolnForUnsteadyHeat::get_source ( const double time,
const Vector< double > &  x,
double source 
)

Source function to make it an exact solution.

141  {
142  double X=x[0];
143  double Y=x[1];
144  source = -2.0*tanh(0.1E1-Alpha*(TanPhi*(X-Beta*tanh(Gamma*cos(0.2E1*
145 MathematicalConstants::Pi*time)))-Y))*(1.0-pow(tanh(0.1E1-Alpha*(TanPhi*(X-
146 Beta*tanh(Gamma*cos(0.2E1*MathematicalConstants::Pi*time)))-Y)),2.0))*Alpha*
147 Alpha*TanPhi*TanPhi-2.0*tanh(0.1E1-Alpha*(TanPhi*(X-Beta*tanh(Gamma*cos(0.2E1*
148 MathematicalConstants::Pi*time)))-Y))*(1.0-pow(tanh(0.1E1-Alpha*(TanPhi*(X-
149 Beta*tanh(Gamma*cos(0.2E1*MathematicalConstants::Pi*time)))-Y)),2.0))*Alpha*
150 Alpha+0.2E1*(1.0-pow(tanh(0.1E1-Alpha*(TanPhi*(X-Beta*tanh(Gamma*cos(0.2E1*
151 MathematicalConstants::Pi*time)))-Y)),2.0))*Alpha*TanPhi*Beta*(1.0-pow(tanh(
152 Gamma*cos(0.2E1*MathematicalConstants::Pi*time)),2.0))*Gamma*sin(0.2E1*
154  }
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References Alpha, Beta, cos(), Gamma, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::pow(), sin(), TestProblem::source(), Eigen::bfloat16_impl::tanh(), TanPhi, plotDoE::x, X, and Y.

Referenced by main(), and run_it().

◆ prescribed_flux_on_fixed_y_boundary()

void TanhSolnForUnsteadyHeat::prescribed_flux_on_fixed_y_boundary ( const double time,
const Vector< double > &  x,
double flux 
)

Flux required by the exact solution on a boundary on which y is fixed.

160  {
161  double X=x[0];
162  double Y=x[1];
163 
164  //The outer unit normal to the boundary is (0,-1)
165  double NX = 0.0;
166  double NY = -1.0;
167 
168  //The flux in terms of the normal is
169  flux = -(1.0-pow(tanh(0.1E1-Alpha*(TanPhi*(X-Beta*tanh(Gamma*cos(0.2E1*
170 MathematicalConstants::Pi*time)))-Y)),2.0))*Alpha*TanPhi*NX+(1.0-pow(tanh(
172 time)))-Y)),2.0))*Alpha*NY;
173  }
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59

References Alpha, Beta, cos(), ProblemParameters::flux(), Gamma, BiharmonicTestFunctions2::Pi, Eigen::bfloat16_impl::pow(), Eigen::bfloat16_impl::tanh(), TanPhi, plotDoE::x, X, and Y.

Referenced by RefineableUnsteadyHeatProblem< ELEMENT >::RefineableUnsteadyHeatProblem().

◆ step_position()

double TanhSolnForUnsteadyHeat::step_position ( const double time)

Position of step (x-axis intercept)

116  {
117  return Beta*tanh(Gamma*cos(0.2E1*MathematicalConstants::Pi*time));
118  }

References Beta, cos(), Gamma, BiharmonicTestFunctions2::Pi, and Eigen::bfloat16_impl::tanh().

Referenced by RefineableUnsteadyHeatProblem< ELEMENT >::doc_solution().

Variable Documentation

◆ Alpha

◆ Beta

double TanhSolnForUnsteadyHeat::Beta

◆ Gamma

double TanhSolnForUnsteadyHeat::Gamma

◆ TanPhi