33 #include "libmesh/parsed_function.h"
54 this->set_parameter(_coefficient, input,
58 if (_coefficient.expression() ==
"0")
59 libmesh_error_msg(
"Warning! Zero VelocityDrag specified!" <<
65 (
const libMesh::Point& point,
66 const libMesh::Real time,
67 const libMesh::NumberVectorValue& U,
68 libMesh::NumberVectorValue& F,
69 libMesh::NumberTensorValue *dFdU)
71 const libMesh::Number Umag = U.norm();
73 const libMesh::Number coeff_val = _coefficient(point, time);
78 const libMesh::Number F_coeff = std::pow(Umag, _exponent-1) * -coeff_val;
84 const libMesh::Number J_coeff =
85 std::pow(Umag, _exponent-2) * -coeff_val * (_exponent-1);
87 const libMesh::Number invUmag = 1/Umag;
89 const libMesh::Number JinvU = J_coeff*invUmag;
91 for (
unsigned int i=0; i != 3; ++i)
93 const libMesh::Number JinvUI = JinvU*U(i);
94 for (
unsigned int j=0; j != 3; ++j)
95 (*dFdU)(i,j) = JinvUI*U(j);
97 (*dFdU)(i,i) += F_coeff;
bool compute_force(const libMesh::Point &point, const libMesh::Real time, const libMesh::NumberVectorValue &U, libMesh::NumberVectorValue &F, libMesh::NumberTensorValue *dFdU=NULL)
Physics class for Incompressible Navier-Stokes.
static PhysicsName velocity_drag()
INSTANTIATE_INC_NS_SUBCLASS(VelocityDragBase)
void read_input_options(const GetPot &input)
Read options from GetPot input file.