HArD::Core3D
Hybrid Arbitrary Degree::Core 3D - Library to implement 3D schemes with vertex, edge, face and cell polynomials as unknowns
Loading...
Searching...
No Matches
Classes | Variables
DDR_navier_stokes

Implementation of the serendipity DDR scheme for the Navier-Stokes problem in curl-curl formulation. More...

Collaboration diagram for DDR_navier_stokes:

Classes

struct  HArDCore3D::StokesNorms
 Structure to store norm components (for velocity, its curl, pressure, and its gradient), as well as Hcurl and Hgrad norms of velocity and pressure. More...
 
struct  HArDCore3D::NavierStokes
 Class to assemble and solve a Navier-Stokes problem. More...
 

Variables

static const double HArDCore3D::PI = boost::math::constants::pi<double>()
 
double HArDCore3D::pressure_scaling = 1.
 
double HArDCore3D::reynolds = 1.
 
double HArDCore3D::navier_scaling = 1.
 
static NavierStokes::VelocityType HArDCore3D::trigonometric_u
 
static NavierStokes::VorticityType HArDCore3D::trigonometric_curl_u
 
static NavierStokes::PressureType HArDCore3D::trigonometric_p
 
static NavierStokes::PressureGradientType HArDCore3D::trigonometric_grad_p
 
static NavierStokes::ForcingTermType HArDCore3D::trigonometric_curl_u_cross_u
 
static NavierStokes::ForcingTermType HArDCore3D::trigonometric_f
 
static NavierStokes::VelocityType HArDCore3D::constant_u
 
static NavierStokes::VorticityType HArDCore3D::constant_curl_u
 
static NavierStokes::ForcingTermType HArDCore3D::constant_curl_u_cross_u
 
static NavierStokes::PressureType HArDCore3D::constant_p
 
static NavierStokes::PressureGradientType HArDCore3D::constant_grad_p
 
static NavierStokes::ForcingTermType HArDCore3D::constant_f
 
static NavierStokes::VelocityType HArDCore3D::linear_u
 
static NavierStokes::VorticityType HArDCore3D::linear_curl_u
 
static NavierStokes::ForcingTermType HArDCore3D::linear_curl_u_cross_u
 
static NavierStokes::PressureType HArDCore3D::linear_p
 
static NavierStokes::PressureGradientType HArDCore3D::linear_grad_p
 
static NavierStokes::ForcingTermType HArDCore3D::linear_f
 
constexpr double HArDCore3D::scal_u = 1.
 
static NavierStokes::VelocityType HArDCore3D::vertical_u
 
static NavierStokes::VorticityType HArDCore3D::vertical_curl_u
 
static NavierStokes::PressureType HArDCore3D::vertical_p = trigonometric_p
 
static NavierStokes::PressureGradientType HArDCore3D::vertical_grad_p = trigonometric_grad_p
 
static NavierStokes::ForcingTermType HArDCore3D::vertical_curl_u_cross_u
 
static NavierStokes::ForcingTermType HArDCore3D::vertical_f
 
static NavierStokes::VelocityType HArDCore3D::pressflux_u
 
static NavierStokes::VorticityType HArDCore3D::pressflux_curl_u
 
static NavierStokes::PressureType HArDCore3D::pressflux_p
 
static NavierStokes::PressureGradientType HArDCore3D::pressflux_grad_p
 
static NavierStokes::ForcingTermType HArDCore3D::pressflux_curl_u_cross_u
 
static NavierStokes::ForcingTermType HArDCore3D::pressflux_f
 

Detailed Description

Implementation of the serendipity DDR scheme for the Navier-Stokes problem in curl-curl formulation.

  1. Model: solve the equations with the following boundary conditions:
    • natural: impose u.n and curl u x n on the boundary.
    • essential: impose the tangential component of u and p on the boundary

  2. Nomenclature: we use the following terms.
    • DOF (degree of freedom): all the components of the velocity and pressure.
    • UKN (unknowns): only the non-Dirichlet components (components in the system before static condensation).
    • SCUKN: statically condensed (eliminated) unknowns.
    • GLUKN: globally coupled unknowns (non-statically condensed).

All the local calculations are made on all the DOFs (including the Lagrange multiplier). It's only when assembling the local contributions that we select the UKN (based on the map DOFtoUKN).

  1. Global vector: the global vector we manipulate has the DOFs of u first, then the DOFs of p, then the Lagrange multiplier. For each u,p we first put the vertices, then edge, then face, then cell DOFs. In each slice (vertex/edge/face) of the DOFs, the Dirichlet ones come first (we have re-numbered the geometric entities to ensure this).

Variable Documentation

◆ constant_curl_u

NavierStokes::VorticityType HArDCore3D::constant_curl_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ constant_curl_u_cross_u

NavierStokes::ForcingTermType HArDCore3D::constant_curl_u_cross_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ constant_f

NavierStokes::ForcingTermType HArDCore3D::constant_f
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ constant_grad_p

NavierStokes::PressureGradientType HArDCore3D::constant_grad_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ constant_p

NavierStokes::PressureType HArDCore3D::constant_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> double {
return 0.;
}

◆ constant_u

NavierStokes::VelocityType HArDCore3D::constant_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d(1., 1., 1.);
}

◆ linear_curl_u

NavierStokes::VorticityType HArDCore3D::linear_curl_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ linear_curl_u_cross_u

NavierStokes::ForcingTermType HArDCore3D::linear_curl_u_cross_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ linear_f

NavierStokes::ForcingTermType HArDCore3D::linear_f
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return linear_grad_p(x);
}
static NavierStokes::PressureGradientType linear_grad_p
Definition sddr-navier-stokes.hpp:582

◆ linear_grad_p

NavierStokes::PressureGradientType HArDCore3D::linear_grad_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return pressure_scaling * Eigen::Vector3d(1., -1., 0.);
}
double pressure_scaling
Definition sddr-navier-stokes.hpp:464

◆ linear_p

NavierStokes::PressureType HArDCore3D::linear_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> double {
return pressure_scaling * (x(0) - x(1));
}

◆ linear_u

NavierStokes::VelocityType HArDCore3D::linear_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return 1e3*Eigen::Vector3d(x(0), -x(1), 0.);
}
@ Matrix
Definition basis.hpp:67

◆ navier_scaling

double HArDCore3D::navier_scaling = 1.

◆ PI

const double HArDCore3D::PI = boost::math::constants::pi<double>()
static

◆ pressflux_curl_u

NavierStokes::VorticityType HArDCore3D::pressflux_curl_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ pressflux_curl_u_cross_u

NavierStokes::ForcingTermType HArDCore3D::pressflux_curl_u_cross_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ pressflux_f

NavierStokes::ForcingTermType HArDCore3D::pressflux_f
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ pressflux_grad_p

NavierStokes::PressureGradientType HArDCore3D::pressflux_grad_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d::Zero();
}

◆ pressflux_p

NavierStokes::PressureType HArDCore3D::pressflux_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> double {
return pressure_scaling * (-x.z());
}

◆ pressflux_u

NavierStokes::VelocityType HArDCore3D::pressflux_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return ( lower_bottom_corner_x_one.is_in(x) ? VectorRd(1., 0., 0.) : VectorRd::Zero());
}
const Hull lower_bottom_corner_x_one({VectorRd(1., 0., 0.), VectorRd(1.,.25, 0.), VectorRd(1.,.25,.25), VectorRd(1., 0.,.25)}, VectorRd(1., 0., 0.))
bool is_in(const VectorRd &x) const
Check if a point is in the convex hull.
Definition BoundaryConditions.cpp:26

◆ pressure_scaling

double HArDCore3D::pressure_scaling = 1.
constexpr

◆ reynolds

double HArDCore3D::reynolds = 1.

◆ scal_u

constexpr double HArDCore3D::scal_u = 1.
constexpr

◆ trigonometric_curl_u

NavierStokes::VorticityType HArDCore3D::trigonometric_curl_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return 3. * PI * Eigen::Vector3d(
cos(2. * PI * x(0)) * sin(2. * PI * x(1)) * sin(2. * PI * x(2)),
-sin(2. * PI * x(0)) * cos(2. * PI * x(1)) * sin(2. * PI * x(2)),
0.
);
}
static const double PI
Definition ddr-magnetostatics.hpp:187

◆ trigonometric_curl_u_cross_u

NavierStokes::ForcingTermType HArDCore3D::trigonometric_curl_u_cross_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d (3.0*PI*sin(2*PI*x.x())*pow(sin(2*PI*x.z()), 2)*cos(2*PI*x.x())*pow(cos(2*PI*x.y()), 2),
3.0*PI*sin(2*PI*x.y())*pow(sin(2*PI*x.z()), 2)*pow(cos(2*PI*x.x()), 2)*cos(2*PI*x.y()),
1.5*PI*pow(sin(2*PI*x.x()), 2)*sin(2*PI*x.z())*pow(cos(2*PI*x.y()), 2)*cos(2*PI*x.z()) + 1.5*PI*pow(sin(2*PI*x.y()), 2)*sin(2*PI*x.z())*pow(cos(2*PI*x.x()), 2)*cos(2*PI*x.z())
);
}

◆ trigonometric_f

NavierStokes::ForcingTermType HArDCore3D::trigonometric_f
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return (1./reynolds) * 6. * std::pow(PI, 2) * Eigen::Vector3d(
sin(2. * PI * x(0)) * cos(2. * PI * x(1)) * cos(2. * PI * x(2)),
cos(2. * PI * x(0)) * sin(2. * PI * x(1)) * cos(2. * PI * x(2)),
-2. * cos(2. * PI * x(0)) * cos(2. * PI * x(1)) * sin(2. * PI * x(2))
)
}
static NavierStokes::ForcingTermType trigonometric_curl_u_cross_u
Definition sddr-navier-stokes.hpp:505
double navier_scaling
Definition sddr-navier-stokes.hpp:466
static NavierStokes::PressureGradientType trigonometric_grad_p
Definition sddr-navier-stokes.hpp:496
double reynolds
Definition sddr-navier-stokes.hpp:465

◆ trigonometric_grad_p

NavierStokes::PressureGradientType HArDCore3D::trigonometric_grad_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return pressure_scaling * 2. * PI * Eigen::Vector3d(
cos(2. * PI * x(0)) * sin(2. * PI * x(1)) * sin(2. * PI * x(2)),
sin(2. * PI * x(0)) * cos(2. * PI * x(1)) * sin(2. * PI * x(2)),
sin(2. * PI * x(0)) * sin(2. * PI * x(1)) * cos(2. * PI * x(2))
);
}

◆ trigonometric_p

NavierStokes::PressureType HArDCore3D::trigonometric_p
static
Initial value:
= [](const Eigen::Vector3d & x) -> double {
return pressure_scaling * sin(2. * PI * x(0)) * sin(2. * PI * x(1)) * sin(2. * PI * x(2));
}

◆ trigonometric_u

NavierStokes::VelocityType HArDCore3D::trigonometric_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return Eigen::Vector3d(
0.5 * sin(2. * PI * x(0)) * cos(2. * PI * x(1)) * cos(2. * PI * x(2)),
0.5 * cos(2. * PI * x(0)) * sin(2. * PI * x(1)) * cos(2. * PI * x(2)),
-cos(2. * PI * x(0)) * cos(2. * PI * x(1)) * sin(2. * PI * x(2))
);
}

◆ vertical_curl_u

NavierStokes::VorticityType HArDCore3D::vertical_curl_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return scal_u * Eigen::Vector3d(0, 0, -PI*sin(PI*x.x()) + PI*sin(PI*x.y()) );
}
constexpr double scal_u
Definition sddr-navier-stokes.hpp:595

◆ vertical_curl_u_cross_u

NavierStokes::ForcingTermType HArDCore3D::vertical_curl_u_cross_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return std::pow(scal_u, 2)
* Eigen::Vector3d (
-(-PI*sin(PI*x.x()) + PI*sin(PI*x.y()))*cos(PI*x.x()),
(-PI*sin(PI*x.x()) + PI*sin(PI*x.y()))*cos(PI*x.y()),
0.
);
}

◆ vertical_f

NavierStokes::ForcingTermType HArDCore3D::vertical_f
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return (1./reynolds) * scal_u * Eigen::Vector3d(pow(PI, 2)*cos(PI*x.y()), pow(PI, 2)*cos(PI*x.x()), 0.)
}
static NavierStokes::ForcingTermType vertical_curl_u_cross_u
Definition sddr-navier-stokes.hpp:613
static NavierStokes::PressureGradientType vertical_grad_p
Definition sddr-navier-stokes.hpp:610

◆ vertical_grad_p

NavierStokes::PressureGradientType HArDCore3D::vertical_grad_p = trigonometric_grad_p
static

◆ vertical_p

NavierStokes::PressureType HArDCore3D::vertical_p = trigonometric_p
static

◆ vertical_u

NavierStokes::VelocityType HArDCore3D::vertical_u
static
Initial value:
= [](const Eigen::Vector3d & x) -> Eigen::Vector3d {
return scal_u * Eigen::Vector3d( cos(PI*x.y()), cos(PI*x.x()), 1.);
}