Skip to content

Commit dd4c4d0

Browse files
committed
6dofs has been improved with a re-acrivated numerical beach and direct imposition of water level at inflow
git-svn-id: svn://svn.sissa.it/openship@566 958231e9-8e66-0410-a4a0-f664109d2741
1 parent 558703b commit dd4c4d0

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

source/boat_model.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ void BoatModel::start_iges_model(std::string igesFileName,
306306
gp_Dir rot_dir(0.0,1.0,0.0);
307307
gp_Ax1 rot_axis(rot_center, rot_dir);
308308
gp_Trsf rotation;
309-
rotation.SetRotation(rot_axis,assigned_trim);
309+
// sign is negative because in "naval-like" reference frame bow-down trim angle is positive
310+
// (in our "aero-like" reference frame x axis is aligned with V_inf, not going from stern to bow)
311+
rotation.SetRotation(rot_axis,-assigned_trim);
310312
//here we prepare the translation of the boat of the requested sink
311313
gp_Trsf translation;
312314
gp_Vec vrt_displ(0.0,0.0,-assigned_sink);

source/free_surface.cc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,6 +3525,10 @@ std::cout<<"Preparing interpolated solution for restart"<<std::endl;
35253525
{
35263526
working_map_points(3*i) = comp_dom.old_map_points(3*i);
35273527
working_map_points(3*i+1) = comp_dom.old_map_points(3*i+1);
3528+
if (comp_dom.flags[i] & near_inflow)
3529+
{
3530+
working_map_points(3*i+2) = comp_dom.old_map_points(3*i+2);
3531+
}
35283532
}
35293533
else if ( !(comp_dom.flags[i] & near_water) &&
35303534
(comp_dom.flags[i] & boat) &&
@@ -5297,6 +5301,11 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
52975301
working_map_points(3*i+1) = comp_dom.old_map_points(3*i+1);
52985302
jacobian_matrix.add(3*i,3*i,1.0);
52995303
jacobian_matrix.add(3*i+1,3*i+1,1.0);
5304+
if (comp_dom.flags[i] & near_inflow)
5305+
{
5306+
working_map_points(3*i+2) = comp_dom.old_map_points(3*i+2);
5307+
jacobian_matrix.add(3*i+2,3*i+2,1.0);
5308+
}
53005309
//cout<<"& "<<3*i<<" "<<3*i+1<<endl;
53015310
}
53025311
else if ( !(comp_dom.flags[i] & near_water) &&
@@ -6784,12 +6793,14 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
67846793
{ //cout<<q<<" "<<phi_dot_rhs_fun[q].val()<<endl;
67856794
fad_double wave_damping_pressure = 0.0;
67866795
//if (comp_dom.no_boat && q_point(0).val() > 0.0)
6787-
// wave_damping_pressure = -fad_double(1)*pow(q_point(0).val(),2.0)/pow(50.0,2.0)*q_dphi_dn;
6796+
fad_double Lx_boat = comp_dom.boat_model.boatWetLength;
6797+
if (q_point(0).val() > Lx_boat*2.0)
6798+
wave_damping_pressure = -fad_double(1.0)*pow(q_point(0).val()-Lx_boat*2.0,2.0)/pow(Lx_boat*4.0,2.0)*q_dphi_dn;
67886799

67896800
eta_dot_rhs_fun[q] = phi_grad*Point<3,fad_double>(fad_double(0.0),fad_double(0.0),fad_double(1.0)) +
67906801
eta_grad*(q_nodes_vel-fluid_vel[q]);
67916802
phi_dot_rhs_fun[q] = phi_grad*phi_grad/2 - q_point*gg + phi_surf_grad_corrected*(q_nodes_vel-fluid_vel[q])-
6792-
breaking_wave_added_pressure;
6803+
breaking_wave_added_pressure +
67936804
+ (1-eta_dry)*fad_double(g*q_init(2)) + wave_damping_pressure;
67946805
//if ( (q_point(0).val() < 3.10) && (q_point(0).val() > 3.03) &&
67956806
// (q_point(1).val() < 0.12) && (q_point(1).val() > 0) &&
@@ -8209,8 +8220,9 @@ Vector<double> & FreeSurface<dim>::differential_components()
82098220
}
82108221
// all other are edges dofs and have first and second algebraic components, third is differential
82118222
else
8212-
{// only exception is when node is a transom_on_water node. in such case it's all algebraic
8213-
if (comp_dom.vector_flags[3*i] & transom_on_water)
8223+
{// only exception is when node is a transom_on_water and near_inflow nodes. in such case it's all algebraic
8224+
if (comp_dom.vector_flags[3*i] & transom_on_water ||
8225+
comp_dom.vector_flags[3*i] & near_inflow)
82148226
{
82158227
for (unsigned int j=0; j<dim; ++j)
82168228
{

waveBem.prm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ set Node displacement type = semilagrangian
9090
# salvato sarà nominato nomefile_10.vtu). Saranno poi salvati un file con desinenza
9191
# _force.txt contenente tutte le forze per ciascun salvataggio, ed un file
9292
# _water_line.txt contenente le coordinate dei nodi in comune tra barca e acqua
93-
set Output file name = OPENSHIP/DTMB_Fr028_FSI_6dofs
93+
set Output file name = OPENSHIP/DTMB_Fr028_FSI_6dofs_coarse
9494

9595
# Massimo numero di time steps: non molto utile, lo leverò
9696
set Maximum number of steps = 10000

0 commit comments

Comments
 (0)