Skip to content

Commit f0a482d

Browse files
committed
this version is working with all 6 dofs active, FSI on vertical motion and no forces on rotations. Next step would be introducing moment in angular velocity differential equations and see what happens. Alternatively, one could force the angular velocity and see if the rotations computed with quaternions come out right.
git-svn-id: svn://svn.sissa.it/openship@563 958231e9-8e66-0410-a4a0-f664109d2741
1 parent a216359 commit f0a482d

2 files changed

Lines changed: 36 additions & 17 deletions

File tree

source/free_surface.cc

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ void FreeSurface<dim>::initial_conditions(Vector<double> &dst) {
369369
{
370370
restart_hull_displacement(2) = hull_z_axis_translation.value(time);
371371
dst(comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs()+5) = restart_hull_displacement(2);
372-
//double vel = ( hull_z_axis_translation.value(time+delta_t) -
373-
// hull_z_axis_translation.value(time+(-1.0*delta_t)) ) / 2.0 / delta_t(0);
374-
double vel = 0.01*2.0*dealii::numbers::PI*cos(2.0*dealii::numbers::PI*initial_time);
372+
double vel = ( hull_z_axis_translation.value(time+delta_t) -
373+
hull_z_axis_translation.value(time+(-1.0*delta_t)) ) / 2.0 / delta_t(0);
374+
//double vel = 0.0; //0.01*2.0*dealii::numbers::PI*cos(2.0*dealii::numbers::PI*initial_time);
375375
cout<<"VELZ: "<<vel<<endl;
376376
dst(comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs()+2) = vel;
377377
}
@@ -4614,7 +4614,7 @@ std::cout<<"Preparing interpolated solution for restart"<<std::endl;
46144614

46154615

46164616
// these lines test the jacobian of the DAE system
4617-
/*
4617+
46184618
Vector<double> delta_y(this->n_dofs());
46194619
Vector<double> delta_res(this->n_dofs());
46204620

@@ -6748,6 +6748,11 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
67486748
{
67496749
Point<3,fad_double> VV_inf(fad_double(Vinf(0)),fad_double(Vinf(1)),fad_double(Vinf(2)));
67506750
fad_double dphi_dt = q_phi_dot - q_nodes_vel*phi_grad;
6751+
//if (q==10)
6752+
// {
6753+
// cout<<"VEL: "<<q_nodes_vel(0).val()<<" "<<q_nodes_vel(1).val()<<" "<<q_nodes_vel(2).val()<<endl;
6754+
// cout<<dphi_dt.val()<<" "<<q_phi_dot.val()<<" "<<(q_nodes_vel*phi_grad).val()<<endl;
6755+
// }
67516756
fad_double local_pressure = -(fad_double(rho)*(dphi_dt+q_point*gg+phi_grad*(phi_grad/2.0+VV_inf))*q_JxW[q]);
67526757
loc_pressure_force += local_pressure*q_normal;
67536758
Point<3,fad_double> q_mom(q_point(1)*loc_pressure_force(2)-q_point(2)*loc_pressure_force(1),
@@ -7090,6 +7095,7 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
70907095
cell->material_id() != comp_dom.free_sur_ID2 &&
70917096
cell->material_id() != comp_dom.free_sur_ID3 )
70927097
{
7098+
70937099
if (cell->material_id() == comp_dom.wall_sur_ID1 ||
70947100
cell->material_id() == comp_dom.wall_sur_ID2 ||
70957101
cell->material_id() == comp_dom.wall_sur_ID3 )
@@ -7174,7 +7180,7 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
71747180
}
71757181

71767182
//if (is_hull_x_translation_imposed != true)
7177-
7183+
/*
71787184
{
71797185
for (unsigned int d=0;d<3;++d)
71807186
jacobian_matrix.add(6+comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs(),
@@ -7243,7 +7249,7 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
72437249
comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+jj,
72447250
-loc_pressure_moment(2).fastAccessDx(j+9*dofs_per_cell));
72457251
}
7246-
7252+
*/
72477253
}
72487254

72497255
if (is_hull_x_translation_imposed != true)
@@ -7304,8 +7310,9 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
73047310
d+9+comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs(),
73057311
-loc_pressure_force(2).fastAccessDx(d+9+10*dofs_per_cell));
73067312
}
7307-
//if (is_hull_y_translation_imposed != true)
73087313

7314+
//if (is_hull_y_translation_imposed != true)
7315+
/*
73097316
{
73107317
for (unsigned int d=0;d<3;++d)
73117318
jacobian_matrix.add(6+comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs(),
@@ -7362,8 +7369,9 @@ int FreeSurface<dim>::residual_and_jacobian(const double t,
73627369
d+9+comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs(),
73637370
-loc_pressure_moment(2).fastAccessDx(d+9+10*dofs_per_cell));
73647371
}
7365-
7372+
*/
73667373
}
7374+
73677375
for (unsigned int i=0;i<dofs_per_cell;++i)
73687376
{
73697377
unsigned int ii = local_dof_indices[i];
@@ -7492,6 +7500,7 @@ else
74927500
{
74937501
hull_lin_vel_res(2)-= pressure_force(2);
74947502
hull_lin_vel_res(2)-= (-g*comp_dom.boat_model.boat_mass);
7503+
cout<<"************ "<<pressure_force(2)<<" vs "<<-g*comp_dom.boat_model.boat_mass<<endl;
74957504
}
74967505

74977506
Point<3,fad_double> hull_quaternions_vect_res(0.0,0.0,0.0);
@@ -7564,6 +7573,16 @@ else
75647573
Point<3,fad_double> vv_dot(v_x_dot,v_y_dot,v_z_dot);
75657574

75667575
Point<3,fad_double> rhs_quat_vect(ss*omega_x+WMatRow1*vv,ss*omega_y+WMatRow2*vv,ss*omega_z+WMatRow1*vv);
7576+
/*
7577+
Point<3,fad_double> hull_ang_vel_res(omega_x_dot,omega_y_dot,omega_z_dot);
7578+
7579+
for (unsigned int k=0; k<3; ++k)
7580+
{
7581+
jacobian_dot_matrix.add(6+k+comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs(),
7582+
6+k+comp_dom.vector_dh.n_dofs()+comp_dom.dh.n_dofs()+comp_dom.dh.n_dofs(),
7583+
1.0);
7584+
}
7585+
*/
75677586

75687587
Point<3,fad_double> hull_ang_vel_res(AbsInertiaMatRow1*omega_dot, AbsInertiaMatRow2*omega_dot, AbsInertiaMatRow3*omega_dot);
75697588
hull_ang_vel_res = hull_ang_vel_res + Point<3,fad_double>(sservMatRow1*omega,sservMatRow3*omega,sservMatRow3*omega);
@@ -7580,10 +7599,10 @@ else
75807599
hull_ang_vel_res(k).fastAccessDx(7+d));
75817600
}
75827601

7583-
for (unsigned int k=0; k<3; ++k)
7584-
{
7585-
hull_ang_vel_res(k) = hull_ang_vel_res(k) - 1.0*pressure_moment(k);
7586-
}
7602+
//for (unsigned int k=0; k<3; ++k)
7603+
// {
7604+
// hull_ang_vel_res(k) = hull_ang_vel_res(k) - 1.0*pressure_moment(k);
7605+
// }
75877606

75887607
hull_quaternions_scal_res = s_dot + omega*vv/2.0;
75897608

waveBem.prm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ set Iges file name = utilities/goteborgExperiments.iges
66
set Boat displacement (Kg) = 0.0 #674.077471967
77

88
# se si conosce il valore di affondamento idrodinamico da aggiungere a quello idrostatico, inserirlo qui
9-
set Assigned sink (m) = 0.00 #0.02
9+
set Assigned sink (m) = 0.01 #0.02
1010

1111
# se si conosce il valore di angolo di beccheggio idrodinamico da aggiungere a quello idrostatico, inserirlo qui
12-
set Assigned trim (rad) = 0.0 #0.02
12+
set Assigned trim (rad) = 0.02 #0.02
1313

1414
# componenti della matrice d'inerzia della barca
1515
set Moment of intertia Ixx (Kg m^2) = 80.0
@@ -201,7 +201,7 @@ subsection IDA Solver Params
201201
set Provide jacobian product = true
202202

203203
# Questo decide ogni quanti secondi viene prodotto un file di output
204-
set Seconds between each output = 0.1
204+
set Seconds between each output = 0.02
205205

206206
# Questo ignoralo: va eliminato (è sempre 0)
207207
set Initial condition type = 0
@@ -267,7 +267,7 @@ end
267267
set Is z-translation imposed = false
268268
subsection Hull z-axis translation
269269
set Function constants =
270-
set Function expression = 0.01*sin(2*3.1415*t)
270+
set Function expression = 0*t#0.01*sin(2*3.1415*t)
271271
set Variable names = t
272272
end
273273

@@ -311,7 +311,7 @@ subsection Wind function 3d
311311
# set Function constants = k=0.017298 # sqrt(g l)/1000 test Hull Full Scale
312312
# set Function constants = k=0.025966 # sqrt(g l)/1000 Macolino Full Scale
313313
# set Function constants = k=0.040968 # sqrt(g l)/1000 Fc Ship Full Scale
314-
set Function expression = 0280*k*if(t < 4, 0.5*sin(3.141592654*(t)/4-3.141592654/2)+0.5, 1 ); 0; 0
314+
set Function expression = 0280*k; 0; 0#*if(t < 4, 0.5*sin(3.141592654*(t)/4-3.141592654/2)+0.5, 1 ); 0; 0
315315
# set Function constants = k=0.62994, omega=2.4835, h=5.5, g=9.81, a=0.01
316316
# set Function expression = 0280*k*if(t < 4, 0.5*sin(3.141592654*(t)/4-3.141592654/2)+0.5, 1 ); 0; 0
317317
set Variable names = x,y,z,t

0 commit comments

Comments
 (0)