33 #include "libmesh/parsed_function.h"
61 std::string coefficient_function =
65 this->_coefficient.reset
66 (
new libMesh::ParsedFunction<libMesh::Number>(coefficient_function));
68 if (coefficient_function ==
"0")
69 std::cout <<
"Warning! Zero VelocityDrag specified!" << std::endl;
74 (
const libMesh::Point& point,
75 const libMesh::Real time,
76 const libMesh::NumberVectorValue& U,
77 libMesh::NumberVectorValue& F,
78 libMesh::NumberTensorValue *dFdU)
80 libmesh_assert(_coefficient.get());
82 const libMesh::Number Umag = U.size();
84 const libMesh::Number coeff_val = (*_coefficient)(point, time);
89 const libMesh::Number F_coeff = std::pow(Umag, _exponent-1) * -coeff_val;
95 const libMesh::Number J_coeff =
96 std::pow(Umag, _exponent-2) * -coeff_val * (_exponent-1);
98 const libMesh::Number invUmag = 1/Umag;
100 const libMesh::Number JinvU = J_coeff*invUmag;
102 for (
unsigned int i=0; i != 3; ++i)
104 const libMesh::Number JinvUI = JinvU*U(i);
105 for (
unsigned int j=0; j != 3; ++j)
106 (*dFdU)(i,j) = JinvUI*U(j);
108 (*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)
const PhysicsName incompressible_navier_stokes
Physics class for Incompressible Navier-Stokes.
INSTANTIATE_INC_NS_SUBCLASS(VelocityDragBase)
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file.
const PhysicsName velocity_drag