TanhSolnForAdvectionDiffusion Namespace Reference

Functions

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...
 
void source_function (const Vector< double > &x_vect, double &source)
 Source function required to make the solution above an exact solution. More...
 
void wind_function (const Vector< double > &x, Vector< double > &wind)
 Wind. More...
 
void tanh_profile (const Vector< double > &x, Vector< double > &u)
 Tanh profile for assignment of boundary conditons as a Vector. More...
 
void tanh_profile (const Vector< double > &x, double &u)
 Tanh profile for assignment of boundary conditons as a Vector. More...
 
void prescribed_flux_on_fixed_x_boundary (const Vector< double > &x, double &flux)
 Flux required by the exact solution on a boundary on which x is fixed. More...
 

Variables

double Peclet =200.0
 Peclet number. More...
 
double Alpha =10.0
 Parameter for steepness of step. More...
 
double TanPhi =1.0
 Parameter for angle of step. More...
 

Detailed Description

Namespace for exact solution for AdvectionDiffusion equation with "sharp" step

Namespace for physical parameters and boundary conditions "sharp" step

Function Documentation

◆ get_exact_u() [1/2]

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

Exact solution as a scalar.

66  {
67  u=tanh(1.0-Alpha*(TanPhi*x[0]-x[1]));
68  }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tanh(const bfloat16 &a)
Definition: BFloat16.h:639
double TanPhi
Parameter for angle of step.
Definition: two_d_adv_diff_adapt.cc:56
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53
list x
Definition: plotDoE.py:28

References Alpha, Eigen::bfloat16_impl::tanh(), TanPhi, and plotDoE::x.

◆ get_exact_u() [2/2]

◆ prescribed_flux_on_fixed_x_boundary()

void TanhSolnForAdvectionDiffusion::prescribed_flux_on_fixed_x_boundary ( const Vector< double > &  x,
double flux 
)

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

90  {
91  //The outer unit normal to the boundary is (1,0)
92  double N[2] = {1.0, 0.0};
93  //The flux in terms of the normal is
94  flux =
95  -(1.0-pow(tanh(-1.0+Alpha*(TanPhi*x[0]-x[1])),2.0))*Alpha*TanPhi*N[0]+(
96  1.0-pow(tanh(-1.0+Alpha*(TanPhi*x[0]-x[1])),2.0))*Alpha*N[1];
97 // Use this one for the funky unforced solution
98 // flux=-1.0;
99  }
EIGEN_DEVICE_FUNC const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow(const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
Definition: GlobalFunctions.h:137
@ N
Definition: constructor.cpp:22
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, ProblemParameters::flux(), N, Eigen::bfloat16_impl::pow(), Eigen::bfloat16_impl::tanh(), TanPhi, and plotDoE::x.

Referenced by TwoMeshFluxAdvectionDiffusionProblem< ELEMENT >::actions_after_adapt(), and TwoMeshFluxAdvectionDiffusionProblem< ELEMENT >::TwoMeshFluxAdvectionDiffusionProblem().

◆ source_function()

void TanhSolnForAdvectionDiffusion::source_function ( const Vector< double > &  x_vect,
double source 
)

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

Zero source function.

72  {
73  double x=x_vect[0];
74  double y=x_vect[1];
75  source =
76 2.0*tanh(-0.1E1+Alpha*(TanPhi*x-y))*(1.0-pow(tanh(-0.1E1+Alpha*(
77 TanPhi*x-y)),2.0))*Alpha*Alpha*TanPhi*TanPhi+2.0*tanh(-0.1E1+Alpha*(TanPhi*x-y)
78 )*(1.0-pow(tanh(-0.1E1+Alpha*(TanPhi*x-y)),2.0))*Alpha*Alpha-Peclet*(-sin(6.0*y
79 )*(1.0-pow(tanh(-0.1E1+Alpha*(TanPhi*x-y)),2.0))*Alpha*TanPhi+cos(6.0*x)*(1.0-
80 pow(tanh(-0.1E1+Alpha*(TanPhi*x-y)),2.0))*Alpha);
81  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
Scalar * y
Definition: level1_cplx_impl.h:128
double Peclet
Peclet number.
Definition: two_d_adv_diff_adapt.cc:50
void source(const Vector< double > &x, Vector< double > &f)
Source function.
Definition: unstructured_two_d_circle.cc:46

References Alpha, cos(), Peclet, Eigen::bfloat16_impl::pow(), sin(), TestProblem::source(), Eigen::bfloat16_impl::tanh(), TanPhi, plotDoE::x, and y.

Referenced by main(), and run_it().

◆ tanh_profile() [1/2]

void TanhSolnForAdvectionDiffusion::tanh_profile ( const Vector< double > &  x,
double u 
)

Tanh profile for assignment of boundary conditons as a Vector.

65  {
66  u=tanh(1.0-Alpha*(TanPhi*x[0]-x[1]));
67  }

References Alpha, Eigen::bfloat16_impl::tanh(), TanPhi, and plotDoE::x.

◆ tanh_profile() [2/2]

void TanhSolnForAdvectionDiffusion::tanh_profile ( const Vector< double > &  x,
Vector< double > &  u 
)

Tanh profile for assignment of boundary conditons as a Vector.

59  {
60  u[0]=tanh(1.0-Alpha*(TanPhi*x[0]-x[1]));
61  }

References Alpha, Eigen::bfloat16_impl::tanh(), TanPhi, and plotDoE::x.

◆ wind_function()

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

Wind.

Wind: Recirculating cells.

85  {
86  wind[0]=sin(6.0*x[1]);
87  wind[1]=cos(6.0*x[0]);
88  }

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

Referenced by main(), and run_it().

Variable Documentation

◆ Alpha

double TanhSolnForAdvectionDiffusion::Alpha =10.0

Parameter for steepness of step.

Parameter for steepness of step in tanh profile.

Referenced by EntryFlowProblem< ELEMENT >::actions_before_newton_solve(), CombCanSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh(), CombTipSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh(), STSpineMesh< ELEMENT, INTERFACE_ELEMENT >::build_single_layer_mesh(), QThermalPVDElement< DIM >::Default_Physical_Constant_Value(), oomph::PolarStreamfunctionTractionElement< ELEMENT >::fill_in_generic_residual_contribution(), oomph::PolarNavierStokesTractionElement< ELEMENT >::fill_in_generic_residual_contribution(), oomph::PolarNavierStokesEquations::fill_in_generic_residual_contribution(), oomph::RefineablePolarNavierStokesEquations::fill_in_generic_residual_contribution(), oomph::RefineablePolarStreamfunctionEquations::fill_in_generic_residual_contribution(), oomph::PolarStreamfunctionEquations::fill_in_generic_residual_contribution(), TanhSolnForLinearWave::get_exact_gradient(), TanhSolnForPoisson::get_exact_gradient(), ArcTanSolnForPoisson::get_exact_gradient(), get_exact_u(), GlobalParameters::get_source(), PolarNSProblem< ELEMENT >::header(), oomph::PolarStreamfunctionEquations::interpolated_vorticity(), main(), oomph::PolarNavierStokesEquations::output(), prescribed_flux_on_fixed_x_boundary(), TanhSolnForPoisson::prescribed_flux_on_fixed_x_boundary(), Global_Parameters::pressure_load(), FlowAroundCylinderProblem< ELEMENT >::set_boundary_conditions(), InclinedPlaneProblem< ELEMENT, INTERFACE_ELEMENT >::solve_steady(), TanhSolnForPoisson::source_function(), source_function(), oomph::PolarNavierStokesEquations::strain_rate(), oomph::PolarNavierStokesEquations::strain_rate_by_r(), and tanh_profile().

◆ Peclet

◆ TanPhi

double TanhSolnForAdvectionDiffusion::TanPhi =1.0