28 #ifndef OOMPH_NAVIER_STOKES_SURFACE_DRAG_TORQUE_ELEMENTS_HEADER
29 #define OOMPH_NAVIER_STOKES_SURFACE_DRAG_TORQUE_ELEMENTS_HEADER
33 #include <oomph-lib-config.h>
46 template<
class ELEMENT>
94 for (
unsigned i = 0;
i <
ndim + 1;
i++)
101 for (
unsigned i = 0;
i < 2 *
ndim - 1;
i++)
103 drag_torque[
i] = 0.0;
122 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
126 for (
unsigned i = 0;
i <
ndim;
i++)
150 bulk_el_pt->interpolated_x(s_bulk, x_bulk);
152 double max_legal_error = 1.0e-5;
154 for (
unsigned i = 0;
i <
ndim + 1;
i++)
158 if (
error > max_legal_error)
160 std::ostringstream error_stream;
161 error_stream <<
"difference in Eulerian posn from bulk and face: "
162 <<
error <<
" exceeds threshold " << max_legal_error
176 bulk_el_pt->interpolated_u_nst(s_bulk, veloc);
181 bulk_el_pt->get_traction(s_bulk,
normal, traction);
184 for (
unsigned i = 0;
i <
ndim + 1;
i++)
186 drag_force[
i] -= traction[
i] *
W;
192 for (
unsigned i = 0;
i <
ndim + 1;
i++)
202 drag_torque[0] -= (
X[0] * traction[1] -
X[1] * traction[0]) *
W;
206 drag_torque[0] -= (
X[1] * traction[2] -
X[2] * traction[1]) *
W;
207 drag_torque[1] -= (
X[2] * traction[0] -
X[0] * traction[2]) *
W;
208 drag_torque[2] -= (
X[0] * traction[1] -
X[1] * traction[0]) *
W;
212 throw OomphLibError(
"Dimension of a surface element must be 1 or 2\n",
230 const unsigned&
i)
const
237 void output(std::ostream& outfile,
const unsigned& n_plot)
243 unsigned dim_el =
dim();
267 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
275 bulk_el_pt->interpolated_x(s_bulk,
x);
278 bulk_el_pt->interpolated_u_nst(s_bulk, veloc);
281 bulk_el_pt->get_traction(s_bulk,
normal, traction);
286 for (
unsigned i = 0;
i < dim_el + 1;
i++)
292 for (
unsigned i = 0;
i < dim_el + 1;
i++)
294 outfile <<
x[
i] <<
" ";
297 for (
unsigned i = 0;
i < dim_el + 1;
i++)
302 for (
unsigned i = 0;
i < dim_el + 1;
i++)
304 outfile << veloc[
i] <<
" ";
307 for (
unsigned i = 0;
i < dim_el + 1;
i++)
309 outfile << -1.0 * traction[
i] <<
" ";
311 outfile << -(
X[0] * traction[1] -
X[1] * traction[0]);
313 outfile << std::endl;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
double value(const unsigned &i) const
Definition: nodes.h:293
Definition: elements.h:5088
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
Definition: elements.cc:6006
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
Definition: elements.h:4735
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4528
double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:5242
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Definition: elements.cc:6384
Definition: elements.h:4998
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
unsigned dim() const
Definition: elements.h:2611
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Definition: elements.h:3174
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
unsigned ndim() const
Access function to # of Eulerian coordinates.
Definition: geom_objects.h:177
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Definition: navier_stokes_surface_drag_torque_elements.h:51
void set_translation_and_rotation(Data *const &object_data_pt)
Definition: navier_stokes_surface_drag_torque_elements.h:72
unsigned Translation_index
The index of where the translation and rotation data is stored.
Definition: navier_stokes_surface_drag_torque_elements.h:328
Vector< double > Centre_of_rotation
The centre of rotation for the torque calculation.
Definition: navier_stokes_surface_drag_torque_elements.h:325
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
Definition: navier_stokes_surface_drag_torque_elements.h:237
virtual void get_drag_and_torque(Vector< double > &drag_force, Vector< double > &drag_torque)
Definition: navier_stokes_surface_drag_torque_elements.h:87
NavierStokesSurfaceDragTorqueElement(FiniteElement *const &element_pt, const int &face_index)
Definition: navier_stokes_surface_drag_torque_elements.h:55
double & centre_of_rotation(const unsigned &i)
Access function for the centre of rotation.
Definition: navier_stokes_surface_drag_torque_elements.h:79
unsigned Dim
The highest dimension of the problem.
Definition: navier_stokes_surface_drag_torque_elements.h:322
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: navier_stokes_surface_drag_torque_elements.h:228
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
Definition: oomph_definitions.h:222
#define X
Definition: icosphere.cpp:20
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
int error
Definition: calibrate.py:297
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86