31#include "PanelLoadTypes.h"
32#include "TwineCrossFlow.h"
34#include <sfh/constants.h>
35#include <sfh/math/math.h>
39namespace hydrodynamics
41namespace twine_friction
64void AddBarFamilyFriction(
double dragFactor,
double frictionCoefficient,
const T barDirection[3],
65 const T effVel[3],
const T& effSpeed, T force[3])
67 const T alongBar = twine_cross_flow_detail::Dot(effVel, barDirection);
68 const T factor = dragFactor * frictionCoefficient * effSpeed * alongBar;
69 for (
int i = 0; i < 3; i++) {
70 force[i] = force[i] + factor * barDirection[i];
89InPlaneFriction<T> EvaluateTwineFriction(
const Netting<T>& netting,
const Fluid& fluid,
const T& solidity,
90 const T velocity[3],
const T normal[3])
92 using namespace twine_cross_flow_detail;
95 InPlaneFriction<T> friction;
96 for (
int i = 0; i < 3; i++) {
97 friction.force[i] = T(0);
100 friction.lift = T(0);
101 if (!netting.hasBarDirections) {
106 const T speedUp = sqrt(2 - solidity) / (sqrt(2.0) * (1 - solidity));
107 const T normalSpeed = Dot(velocity, normal);
109 for (
int i = 0; i < 3; i++) {
110 effVel[i] = velocity[i] + (speedUp - 1) * normalSpeed * normal[i];
112 const T effSpeed = sfh::math::Bound(sfh::math::Norm(effVel, 3), T(kMinSpeed), T(kMaxSpeed));
114 const double twineLength = sfh::math::Max(netting.barLength - netting.knotDiameter, 0.0);
115 const double barDragFactor = 0.5 * fluid.rho * netting.twineThickness * twineLength;
116 const double frictionCoefficient = TwineCrossFlow {}.ct * sfh::pi;
117 AddBarFamilyFriction(barDragFactor * netting.numBarsU, frictionCoefficient, netting.barU, effVel, effSpeed, friction.force);
118 AddBarFamilyFriction(barDragFactor * netting.numBarsV, frictionCoefficient, netting.barV, effVel, effSpeed, friction.force);
120 const T boundedSpeed = sfh::math::Max(sfh::math::Norm(velocity, 3), T(kMinSpeed));
122 for (
int i = 0; i < 3; i++) {
123 flowDirection[i] = velocity[i] / boundedSpeed;
125 T cosTheta = Dot(flowDirection, normal);
126 T normalDownstream[3];
127 for (
int i = 0; i < 3; i++) {
128 normalDownstream[i] = (cosTheta < 0) ? -normal[i] : normal[i];
131 cosTheta = -cosTheta;
134 for (
int i = 0; i < 3; i++) {
135 liftDirection[i] = normalDownstream[i] - cosTheta * flowDirection[i];
137 const T liftDirectionNorm =
138 sfh::math::Max(sfh::math::Norm(liftDirection, 3), T(kMinLiftDirectionNorm));
140 friction.drag = Dot(friction.force, flowDirection);
141 friction.lift = Dot(friction.force, liftDirection) / liftDirectionNorm;
The in-plane friction force and its projections on the drag and lift directions.
Definition TwineFriction.h:47
T force[3]
N, global frame, in the panel plane.
Definition TwineFriction.h:48
T drag
N, the projection of force on U-hat.
Definition TwineFriction.h:49
T lift
N, the projection of force on L-hat.
Definition TwineFriction.h:50