RachelsAdvectionDiffusion Namespace Reference

Functions

void get_exact_u (const Vector< double > &x, Vector< double > &u)
 The asymptotic solution. More...
 
void wind_function (const Vector< double > &x, Vector< double > &wind)
 Wind (the underlying velocity field) More...
 
void swimming (const Vector< double > &x, Vector< double > &swim)
 Conserved bit (the swiming velocity) More...
 
void diff_function (const Vector< double > &x, DenseMatrix< double > &D)
 Diffusivity tensor. More...
 

Variables

double Peclet =0.01
 Peclet number. More...
 
double U = 0.7
 Swimming speed. More...
 
double D11 = 0.1
 
double D22 = 0.2
 
const double pi = MathematicalConstants::Pi
 The value of pi. More...
 

Detailed Description

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

Function Documentation

◆ diff_function()

void RachelsAdvectionDiffusion::diff_function ( const Vector< double > &  x,
DenseMatrix< double > &  D 
)

Diffusivity tensor.

126  {
127  D(0,0) = D11;
128  D(0,1) = 0.0;
129  D(1,0) = 0.0;
130  D(1,1) = D22;
131  }
dominoes D
Definition: Domino.cpp:55
double D11
Definition: two_d_variable_diff_adapt.cc:57
double D22
Definition: two_d_variable_diff_adapt.cc:58

References D, D11, and D22.

Referenced by main().

◆ get_exact_u()

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

The asymptotic solution.

65  {
66  double gamma = U/D22;
67  //Leading order term
68  u[0] = std::exp(gamma*x[1]);
69 
70  //Get the surd in the solution of the ODE
71  double surd = sqrt(0.25*gamma*gamma + pi*pi*D11/D22);
72  //Powers of the exponentials
73  double alpha = 0.5*gamma + surd;
74  double beta = 0.5*gamma - surd;
75 
76  //Coefficients of the exact solution
77  double Gamma = 2.0*D22*pi*gamma - U*pi;
78  double Kappa = D22*(gamma*gamma - pi*pi) - U*gamma - D11*pi*pi;
79 
80  double temp = pi*gamma/(Gamma*Gamma + Kappa*Kappa);
81 
82  double A = - Kappa*temp;
83  double B = Gamma*temp;
84 
85  //Now the final messy bit
86  double C = (gamma - alpha)*exp(alpha);
87  double D = (gamma - beta)*exp(beta);
88 
89  double b = (pi*A*exp(gamma) - C*B)/(C - D);
90  double a = -B -b;
91 
92  //Done, I hope
93  double f= a*exp(alpha*x[1]) + b*exp(beta*x[1]) +
94  (A*sin(pi*x[1]) + B*cos(pi*x[1]))*exp(gamma*x[1]);
95 
96  /*double fprime = a*alpha*exp(alpha*x[1]) + b*beta*exp(beta*x[1])
97  + ((pi*A + B*gamma)*cos(pi*x[1]) + (gamma*A- pi*B)*sin(pi*x[1]))
98  *exp(gamma*x[1]);
99 
100  double fpp = a*alpha*alpha*exp(alpha*x[1]) + b*beta*beta*exp(beta*x[1])
101  + (-pi*(pi*A + B*gamma)*sin(pi*x[1])
102  + pi*(gamma*A - pi*B)*cos(pi*x[1]))*exp(gamma*x[1])
103  + ((pi*A + B*gamma)*cos(pi*x[1]) + (gamma*A- pi*B)*sin(pi*x[1]))
104  *gamma*exp(gamma*x[1]);*/
105 
106  //Add the first-order term
107  u[0] += Peclet*cos(pi*x[0])*f;
108  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
Scalar * b
Definition: benchVecAdd.cpp:17
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:48
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Definition: matrices.h:74
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar alpha
Definition: level1_cplx_impl.h:151
const Scalar * a
Definition: level2_cplx_impl.h:32
Scalar beta
Definition: level2_cplx_impl.h:36
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
double Gamma
Aspect ratio (cylinder height / cylinder radius)
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:70
const double pi
The value of pi.
Definition: two_d_variable_diff_adapt.cc:61
double Peclet
Peclet number.
Definition: two_d_variable_diff_adapt.cc:50
double U
Swimming speed.
Definition: two_d_variable_diff_adapt.cc:53
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Definition: ExtendedMath.cc:116
list x
Definition: plotDoE.py:28

References a, alpha, b, beta, cos(), D, D11, D22, Eigen::bfloat16_impl::exp(), f(), mathsFunc::gamma(), GlobalPhysicalVariables::Gamma, Peclet, pi, sin(), sqrt(), U, and plotDoE::x.

◆ swimming()

void RachelsAdvectionDiffusion::swimming ( const Vector< double > &  x,
Vector< double > &  swim 
)

Conserved bit (the swiming velocity)

119  {
120  swim[0] = 0.0;
121  swim[1] = U;
122  }

References U.

Referenced by main().

◆ wind_function()

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

Wind (the underlying velocity field)

112  {
113  wind[0]= pi*cos(pi*x[1])*sin(pi*x[0]);
114  wind[1]= -pi*sin(pi*x[1])*cos(pi*x[0]);
115  }

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

Referenced by main().

Variable Documentation

◆ D11

double RachelsAdvectionDiffusion::D11 = 0.1

Referenced by diff_function(), and get_exact_u().

◆ D22

double RachelsAdvectionDiffusion::D22 = 0.2

Referenced by diff_function(), and get_exact_u().

◆ Peclet

double RachelsAdvectionDiffusion::Peclet =0.01

◆ pi

const double RachelsAdvectionDiffusion::pi = MathematicalConstants::Pi

The value of pi.

Referenced by get_exact_u(), and wind_function().

◆ U

double RachelsAdvectionDiffusion::U = 0.7

Swimming speed.

Referenced by CFDDEMCoupleTest::actionsAfterTimeStep(), oomph::Newmark< NSTEPS >::assign_initial_data_values(), oomph::Newmark< NSTEPS >::assign_initial_data_values_stage2(), Eigen::Spline< Scalar_, Dim_, Degree_ >::BasisFunctionDerivativesImpl(), Eigen::Spline< Scalar_, Dim_, Degree_ >::BasisFunctions(), NurbsUtils::bsplineOneBasis(), oomph::RefineableQElement< 3 >::check_integrity(), Eigen::BDCSVD< MatrixType_, Options_ >::computeSingVecs(), Eigen::BDCSVD< MatrixType_, Options_ >::computeSVDofM(), oomph::OcTree::construct_rotation_matrix(), oomph::OcTreeForest::construct_up_right_equivalents(), BaseHandler< T >::copyAndAddGhostObject(), BaseHandler< T >::copyAndAddObject(), oomph::OcTree::edge_neighbour_is_face_neighbour(), UnsteadyHeatProblem< ELEMENT >::enforce_time_periodic_boundary_conditions(), oomph::OcTree::faces_of_common_edge(), oomph::OcTreeForest::find_neighbours(), Eigen::generateRandomMatrixSvs(), OrrSommerfeldEquations< DIM >::get_base_flow(), get_exact_u(), oomph::RefineableQElement< 3 >::get_face_bcs(), oomph::RefineableSolidQElement< 3 >::get_face_solid_bcs(), oomph::OcTree::gteq_face_neighbour(), oomph::OcTree::gteq_true_edge_neighbour(), Eigen::internal::idrs(), Eigen::internal::idrstabl(), oomph::RefineableQElement< 3 >::interpolated_zeta_on_face(), oomph::WarpedCubeDomain::macro_element_boundary(), oomph::QuarterPipeDomain::macro_element_boundary(), oomph::QuarterTubeDomain::macro_element_boundary(), oomph::TubeDomain::macro_element_boundary(), oomph::EighthSphereDomain::macro_element_boundary(), Eigen::internal::matrix_exp_compute(), Eigen::internal::matrix_exp_pade13(), Eigen::internal::matrix_exp_pade3(), Eigen::internal::matrix_exp_pade5(), Eigen::internal::matrix_exp_pade7(), Eigen::internal::matrix_exp_pade9(), Eigen::internal::matrix_function_permute_schur(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_neighbour(), oomph::RefineableQElement< 3 >::node_created_by_neighbour(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_son_of_neighbour(), oomph::RefineableQElement< 3 >::oc_hang_helper(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::oc_hang_helper(), Eigen::internal::SparseLUImpl< Scalar, StorageIndex >::panel_bmod(), oomph::RefineableQSpectralElement< 3 >::rebuild_from_sons(), Eigen::MatrixPower< MatrixType >::revertSchur(), oomph::OcTree::rotate(), Eigen::internal::matrix_exp_computeUV< MatrixType, float >::run(), Eigen::internal::matrix_exp_computeUV< MatrixType, double >::run(), Eigen::internal::matrix_exp_computeUV< MatrixType, long double >::run(), Eigen::internal::matrix_function_compute< MatrixType, 1 >::run(), Eigen::internal::matrix_sqrt_compute< MatrixType, 0 >::run(), Eigen::internal::matrix_sqrt_compute< MatrixType, 1 >::run(), processTriangularMatrix< MatrixType, 0 >::run(), schur(), UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents(), oomph::RefineableQElement< 3 >::setup_hang_for_value(), oomph::RefineableQElement< 3 >::setup_hanging_nodes(), oomph::OcTree::setup_static_data(), Eigen::SparseLUMatrixUReturnType< MatrixLType, MatrixUType >::solveInPlace(), Eigen::internal::MappedSuperNodalMatrix< Scalar_, StorageIndex_ >::solveInPlace(), Eigen::SparseLUMatrixUReturnType< MatrixLType, MatrixUType >::solveTransposedInPlace(), Eigen::internal::MappedSuperNodalMatrix< Scalar_, StorageIndex_ >::solveTransposedInPlace(), svd_fill_random(), swimming(), and testSingular().