@@ -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
0 commit comments