#include <MoFEM.hpp>
#include <MethodForForceScaling.hpp>
#include <NavierStokesElement.hpp>
Go to the source code of this file.
◆ stokes_flow_velocity()
- Examples
- NavierStokesElement.cpp.
Definition at line 1071 of file NavierStokesElement.cpp.
1072 double r = std::sqrt(x * x + y * y + z * z);
1073 double theta = acos(x /
r);
1074 double phi = atan2(y, z);
1075 double ur = cos(theta) * (1.0 + 0.5 / (
r *
r *
r) - 1.5 /
r);
1076 double ut = -sin(theta) * (1.0 - 0.25 / (
r *
r *
r) - 0.75 /
r);
1078 res[0] = ur * cos(theta) - ut * sin(theta);
1079 res[1] = ur * sin(theta) * sin(
phi) + ut * cos(theta) * sin(
phi);
1080 res[2] = ur * sin(theta) * cos(
phi) + ut * cos(theta) * cos(
phi);