39 template<
unsigned DIM>
48 template<
unsigned DIM>
49 int GeneralisedNewtonianNavierStokesEquations<
50 DIM>::Pressure_not_stored_at_node = -100;
53 template<
unsigned DIM>
54 double GeneralisedNewtonianNavierStokesEquations<
58 template<
unsigned DIM>
59 double GeneralisedNewtonianNavierStokesEquations<
60 DIM>::Default_Physical_Ratio_Value = 1.0;
63 template<
unsigned DIM>
64 Vector<double> GeneralisedNewtonianNavierStokesEquations<
65 DIM>::Default_Gravity_vector(DIM, 0.0);
69 template<
unsigned DIM>
70 bool GeneralisedNewtonianNavierStokesEquations<
71 DIM>::Pre_multiply_by_viscosity_ratio =
false;
80 template<
unsigned DIM>
85 const unsigned& which_one)
88 unsigned n_dof = ndof();
90 if ((which_one == 0) || (which_one == 1))
91 press_mass_diag.assign(n_dof, 0.0);
92 if ((which_one == 0) || (which_one == 2))
93 veloc_mass_diag.assign(n_dof, 0.0);
96 unsigned n_node = nnode();
99 unsigned n_dim = this->dim();
106 for (
unsigned i = 0;
i < n_dim;
i++)
108 u_nodal_index[
i] = this->u_index_nst(
i);
115 unsigned n_pres = npres_nst();
121 unsigned n_intpt = integral_pt()->nweight();
127 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
130 double w = integral_pt()->weight(ipt);
133 double J = J_eulerian_at_knot(ipt);
136 for (
unsigned i = 0;
i < n_dim;
i++)
138 s[
i] = integral_pt()->knot(ipt,
i);
146 if ((which_one == 0) || (which_one == 2))
149 shape_at_knot(ipt, psi);
152 for (
unsigned l = 0; l < n_node; l++)
155 for (
unsigned i = 0;
i < n_dim;
i++)
157 local_eqn = nodal_local_eqn(l, u_nodal_index[
i]);
163 veloc_mass_diag[local_eqn] += pow(psi[l], 2) *
W;
170 if ((which_one == 0) || (which_one == 1))
173 pshape_nst(
s, psi_p);
176 for (
unsigned l = 0; l < n_pres; l++)
179 local_eqn = p_local_eqn(l);
185 press_mass_diag[local_eqn] += pow(psi_p[l], 2) *
W;
199 template<
unsigned DIM>
201 std::ostream& outfile,
217 unsigned n_intpt = integral_pt()->nweight();
219 outfile <<
"ZONE" << std::endl;
225 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
228 for (
unsigned i = 0;
i < DIM;
i++)
230 s[
i] = integral_pt()->knot(ipt,
i);
234 double w = integral_pt()->weight(ipt);
237 double J = J_eulerian(
s);
243 interpolated_x(
s, x);
246 (*exact_soln_pt)(time, x, exact_soln);
249 for (
unsigned i = 0;
i < DIM;
i++)
251 norm += exact_soln[
i] * exact_soln[
i] *
W;
252 error += (exact_soln[
i] - interpolated_u_nst(
s,
i)) *
253 (exact_soln[
i] - interpolated_u_nst(
s,
i)) *
W;
257 for (
unsigned i = 0;
i < DIM;
i++)
259 outfile << x[
i] <<
" ";
263 for (
unsigned i = 0;
i < DIM;
i++)
265 outfile << exact_soln[
i] - interpolated_u_nst(
s,
i) <<
" ";
268 outfile << std::endl;
278 template<
unsigned DIM>
280 std::ostream& outfile,
295 unsigned n_intpt = integral_pt()->nweight();
298 outfile <<
"ZONE" << std::endl;
304 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
307 for (
unsigned i = 0;
i < DIM;
i++)
309 s[
i] = integral_pt()->knot(ipt,
i);
313 double w = integral_pt()->weight(ipt);
316 double J = J_eulerian(
s);
322 interpolated_x(
s, x);
325 (*exact_soln_pt)(x, exact_soln);
328 for (
unsigned i = 0;
i < DIM;
i++)
330 norm += exact_soln[
i] * exact_soln[
i] *
W;
331 error += (exact_soln[
i] - interpolated_u_nst(
s,
i)) *
332 (exact_soln[
i] - interpolated_u_nst(
s,
i)) *
W;
336 for (
unsigned i = 0;
i < DIM;
i++)
338 outfile << x[
i] <<
" ";
342 for (
unsigned i = 0;
i < DIM;
i++)
344 outfile << exact_soln[
i] - interpolated_u_nst(
s,
i) <<
" ";
346 outfile << std::endl;
356 template<
unsigned DIM>
358 std::ostream& outfile,
359 const unsigned& nplot,
369 outfile << tecplot_zone_string(nplot);
375 unsigned num_plot_points = nplot_points(nplot);
376 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
379 get_s_plot(iplot, nplot,
s);
382 interpolated_x(
s, x);
385 (*exact_soln_pt)(x, exact_soln);
388 for (
unsigned i = 0;
i < DIM;
i++)
390 outfile << x[
i] <<
" ";
394 for (
unsigned i = 0;
i < exact_soln.size();
i++)
396 outfile << exact_soln[
i] <<
" ";
399 outfile << std::endl;
403 write_tecplot_zone_footer(outfile, nplot);
412 template<
unsigned DIM>
414 std::ostream& outfile,
415 const unsigned& nplot,
426 outfile << tecplot_zone_string(nplot);
432 unsigned num_plot_points = nplot_points(nplot);
433 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
436 get_s_plot(iplot, nplot,
s);
439 interpolated_x(
s, x);
442 (*exact_soln_pt)(time, x, exact_soln);
445 for (
unsigned i = 0;
i < DIM;
i++)
447 outfile << x[
i] <<
" ";
451 for (
unsigned i = 0;
i < exact_soln.size();
i++)
453 outfile << exact_soln[
i] <<
" ";
456 outfile << std::endl;
460 write_tecplot_zone_footer(outfile, nplot);
470 template<
unsigned DIM>
472 std::ostream& outfile,
const unsigned& nplot,
const unsigned&
t)
475 unsigned n_node = nnode();
486 outfile << tecplot_zone_string(nplot);
489 unsigned num_plot_points = nplot_points(nplot);
490 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
493 get_s_plot(iplot, nplot,
s);
499 for (
unsigned i = 0;
i < DIM;
i++)
501 interpolated_x[
i] = 0.0;
502 interpolated_u[
i] = 0.0;
504 unsigned u_nodal_index = u_index_nst(
i);
506 for (
unsigned l = 0; l < n_node; l++)
508 interpolated_u[
i] += nodal_value(
t, l, u_nodal_index) * psi[l];
509 interpolated_x[
i] += nodal_position(
t, l,
i) * psi[l];
514 for (
unsigned i = 0;
i < DIM;
i++)
516 outfile << interpolated_x[
i] <<
" ";
520 for (
unsigned i = 0;
i < DIM;
i++)
522 outfile << interpolated_u[
i] <<
" ";
525 outfile << std::endl;
529 write_tecplot_zone_footer(outfile, nplot);
538 template<
unsigned DIM>
540 std::ostream& outfile,
const unsigned& nplot)
546 outfile << tecplot_zone_string(nplot);
549 unsigned num_plot_points = nplot_points(nplot);
550 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
553 get_s_plot(iplot, nplot,
s);
556 for (
unsigned i = 0;
i < DIM;
i++)
558 outfile << interpolated_x(
s,
i) <<
" ";
562 for (
unsigned i = 0;
i < DIM;
i++)
564 outfile << interpolated_u_nst(
s,
i) <<
" ";
568 outfile << interpolated_p_nst(
s) <<
" ";
570 outfile << std::endl;
572 outfile << std::endl;
575 write_tecplot_zone_footer(outfile, nplot);
585 template<
unsigned DIM>
587 FILE* file_pt,
const unsigned& nplot)
593 fprintf(file_pt,
"%s", tecplot_zone_string(nplot).c_str());
596 unsigned num_plot_points = nplot_points(nplot);
597 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
600 get_s_plot(iplot, nplot,
s);
603 for (
unsigned i = 0;
i < DIM;
i++)
605 fprintf(file_pt,
"%g ", interpolated_x(
s,
i));
609 for (
unsigned i = 0;
i < DIM;
i++)
611 fprintf(file_pt,
"%g ", interpolated_u_nst(
s,
i));
615 fprintf(file_pt,
"%g \n", interpolated_p_nst(
s));
617 fprintf(file_pt,
"\n");
620 write_tecplot_zone_footer(file_pt, nplot);
630 template<
unsigned DIM>
632 std::ostream& outfile,
const unsigned& nplot)
644 outfile << tecplot_zone_string(nplot);
647 unsigned n_node = nnode();
651 DShape dpsifdx(n_node, DIM);
654 unsigned num_plot_points = nplot_points(nplot);
655 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
658 get_s_plot(iplot, nplot,
s);
661 dshape_eulerian(
s, psif, dpsifdx);
670 for (
unsigned i = 0;
i < DIM;
i++)
675 for (
unsigned j = 0; j < DIM; j++)
677 interpolated_dudx(
i, j) = 0.0;
685 for (
unsigned i = 0;
i < DIM;
i++)
688 unsigned u_nodal_index = u_index_nst(
i);
690 for (
unsigned l = 0; l < n_node; l++)
692 dudt[
i] += du_dt_nst(l, u_nodal_index) * psif[l];
693 mesh_veloc[
i] += dnodal_position_dt(l,
i) * psif[l];
696 for (
unsigned j = 0; j < DIM; j++)
698 interpolated_dudx(
i, j) +=
699 nodal_value(l, u_nodal_index) * dpsifdx(l, j);
706 for (
unsigned i = 0;
i < DIM;
i++)
708 dudt_ALE[
i] = dudt[
i];
709 for (
unsigned k = 0; k < DIM; k++)
711 dudt_ALE[
i] -= mesh_veloc[k] * interpolated_dudx(
i, k);
717 for (
unsigned i = 0;
i < DIM;
i++)
719 outfile << interpolated_x(
s,
i) <<
" ";
723 for (
unsigned i = 0;
i < DIM;
i++)
725 outfile << interpolated_u_nst(
s,
i) <<
" ";
729 outfile << interpolated_p_nst(
s) <<
" ";
732 for (
unsigned i = 0;
i < DIM;
i++)
734 outfile << dudt_ALE[
i] <<
" ";
744 outfile << dissipation(
s) <<
" ";
747 outfile << std::endl;
751 write_tecplot_zone_footer(outfile, nplot);
761 template<
unsigned DIM>
763 std::ostream& outfile,
const unsigned& nplot)
781 "Can't output vorticity in 1D - in fact, what do you mean\n";
782 error_message +=
"by the 1D Navier-Stokes equations?\n";
785 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
789 outfile << tecplot_zone_string(nplot);
792 unsigned num_plot_points = nplot_points(nplot);
793 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
796 get_s_plot(iplot, nplot,
s);
799 for (
unsigned i = 0;
i < DIM;
i++)
801 outfile << interpolated_x(
s,
i) <<
" ";
805 get_vorticity(
s, vorticity);
809 outfile << vorticity[0];
813 outfile << vorticity[0] <<
" " << vorticity[1] <<
" " << vorticity[2]
817 outfile << std::endl;
819 outfile << std::endl;
822 write_tecplot_zone_footer(outfile, nplot);
829 template<
unsigned DIM>
833 "Check the dissipation calculation for GeneralisedNewtonian NSt",
834 OOMPH_CURRENT_FUNCTION,
835 OOMPH_EXCEPTION_LOCATION);
841 unsigned n_intpt = integral_pt()->nweight();
847 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
850 for (
unsigned i = 0;
i < DIM;
i++)
852 s[
i] = integral_pt()->knot(ipt,
i);
856 double w = integral_pt()->weight(ipt);
859 double J = J_eulerian(
s);
863 strain_rate(
s, strainrate);
866 double local_diss = 0.0;
867 for (
unsigned i = 0;
i < DIM;
i++)
869 for (
unsigned j = 0; j < DIM; j++)
871 local_diss += 2.0 * strainrate(
i, j) * strainrate(
i, j);
875 diss += local_diss * w * J;
886 template<
unsigned DIM>
895 if (!Use_extrapolated_strainrate_to_compute_second_invariant)
897 strain_rate(
s, strainrate);
901 extrapolated_strain_rate(
s, strainrate);
911 double press = interpolated_p_nst(
s);
914 for (
unsigned i = 0;
i < DIM;
i++)
916 traction[
i] = -press *
N[
i];
917 for (
unsigned j = 0; j < DIM; j++)
919 traction[
i] += visc * 2.0 * strainrate(
i, j) *
N[j];
930 template<
unsigned DIM>
945 if (!Use_extrapolated_strainrate_to_compute_second_invariant)
947 strain_rate(
s, strainrate);
951 extrapolated_strain_rate(
s, strainrate);
961 double press = interpolated_p_nst(
s);
964 for (
unsigned i = 0;
i < DIM;
i++)
967 traction_p[
i] = -press *
N[
i];
968 for (
unsigned j = 0; j < DIM; j++)
971 traction_visc[
i] += visc * 2.0 * strainrate(
i, j) *
N[j];
974 traction_visc_n[
i] = traction_visc[
i] *
N[
i];
975 traction_visc_t[
i] = traction_visc[
i] - traction_visc_n[
i];
982 template<
unsigned DIM>
987 "Check the dissipation calculation for GeneralisedNewtonian NSt",
988 OOMPH_CURRENT_FUNCTION,
989 OOMPH_EXCEPTION_LOCATION);
993 strain_rate(
s, strainrate);
996 double local_diss = 0.0;
997 for (
unsigned i = 0;
i < DIM;
i++)
999 for (
unsigned j = 0; j < DIM; j++)
1001 local_diss += 2.0 * strainrate(
i, j) * strainrate(
i, j);
1011 template<
unsigned DIM>
1016 if ((strainrate.
ncol() != DIM) || (strainrate.
nrow() != DIM))
1018 std::ostringstream error_message;
1019 error_message <<
"The strain rate has incorrect dimensions "
1020 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
1021 <<
" Not " << DIM << std::endl;
1024 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1032 unsigned n_node = nnode();
1036 DShape dpsidx(n_node, DIM);
1039 dshape_eulerian(
s, psi, dpsidx);
1042 for (
unsigned i = 0;
i < DIM;
i++)
1044 for (
unsigned j = 0; j < DIM; j++)
1051 for (
unsigned i = 0;
i < DIM;
i++)
1054 unsigned u_nodal_index = u_index_nst(
i);
1056 for (
unsigned j = 0; j < DIM; j++)
1059 for (
unsigned l = 0; l < n_node; l++)
1061 dudx(
i, j) += nodal_value(l, u_nodal_index) * dpsidx(l, j);
1067 for (
unsigned i = 0;
i < DIM;
i++)
1070 for (
unsigned j = 0; j < DIM; j++)
1072 strainrate(
i, j) = 0.5 * (dudx(
i, j) + dudx(j,
i));
1081 template<
unsigned DIM>
1088 if ((strainrate.
ncol() != DIM) || (strainrate.
nrow() != DIM))
1090 std::ostringstream error_message;
1091 error_message <<
"The strain rate has incorrect dimensions "
1092 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
1093 <<
" Not " << DIM << std::endl;
1096 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1104 unsigned n_node = nnode();
1108 DShape dpsidx(n_node, DIM);
1113 for (
unsigned j = 0; j < n_node; j++)
1115 for (
unsigned k = 0; k < DIM; k++)
1117 backed_up_nodal_position(j, k) = node_pt(j)->x(k);
1118 node_pt(j)->x(k) = node_pt(j)->x(
t, k);
1123 dshape_eulerian(
s, psi, dpsidx);
1126 for (
unsigned i = 0;
i < DIM;
i++)
1128 for (
unsigned j = 0; j < DIM; j++)
1135 for (
unsigned i = 0;
i < DIM;
i++)
1138 unsigned u_nodal_index = u_index_nst(
i);
1140 for (
unsigned j = 0; j < DIM; j++)
1143 for (
unsigned l = 0; l < n_node; l++)
1145 dudx(
i, j) += nodal_value(
t, l, u_nodal_index) * dpsidx(l, j);
1151 for (
unsigned i = 0;
i < DIM;
i++)
1154 for (
unsigned j = 0; j < DIM; j++)
1156 strainrate(
i, j) = 0.5 * (dudx(
i, j) + dudx(j,
i));
1161 for (
unsigned j = 0; j < n_node; j++)
1163 for (
unsigned k = 0; k < DIM; k++)
1165 node_pt(j)->x(k) = backed_up_nodal_position(j, k);
1174 template<
unsigned DIM>
1179 if ((strainrate.
ncol() != DIM) || (strainrate.
nrow() != DIM))
1181 std::ostringstream error_message;
1182 error_message <<
"The strain rate has incorrect dimensions "
1183 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
1184 <<
" Not " << DIM << std::endl;
1187 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1193 strain_rate(2,
s, strain_rate_minus_two);
1196 strain_rate(1,
s, strain_rate_minus_one);
1199 TimeStepper* time_stepper_pt = node_pt(0)->time_stepper_pt();
1202 double dt_current = time_stepper_pt->
time_pt()->
dt(0);
1203 double dt_prev = time_stepper_pt->
time_pt()->
dt(1);
1206 for (
unsigned i = 0;
i < DIM;
i++)
1208 for (
unsigned j = 0; j < DIM; j++)
1212 (strain_rate_minus_one(
i, j) - strain_rate_minus_two(
i, j)) / dt_prev;
1215 strainrate(
i, j) = strain_rate_minus_one(
i, j) + slope * dt_current;
1230 if (vorticity.size() != 1)
1232 std::ostringstream error_message;
1233 error_message <<
"Computation of vorticity in 2D requires a 1D vector\n"
1234 <<
"which contains the only non-zero component of the\n"
1235 <<
"vorticity vector. You've passed a vector of size "
1236 << vorticity.size() << std::endl;
1239 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1250 unsigned n_node = nnode();
1254 DShape dpsidx(n_node, DIM);
1257 dshape_eulerian(
s, psi, dpsidx);
1260 for (
unsigned i = 0;
i < DIM;
i++)
1262 for (
unsigned j = 0; j < DIM; j++)
1269 for (
unsigned i = 0;
i < DIM;
i++)
1272 unsigned u_nodal_index = u_index_nst(
i);
1274 for (
unsigned j = 0; j < DIM; j++)
1277 for (
unsigned l = 0; l < n_node; l++)
1279 dudx(
i, j) += nodal_value(l, u_nodal_index) * dpsidx(l, j);
1285 vorticity[0] = dudx(1, 0) - dudx(0, 1);
1297 if (vorticity.size() != 3)
1299 std::ostringstream error_message;
1300 error_message <<
"Computation of vorticity in 3D requires a 3D vector\n"
1301 <<
"which contains the only non-zero component of the\n"
1302 <<
"vorticity vector. You've passed a vector of size "
1303 << vorticity.size() << std::endl;
1306 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1317 unsigned n_node = nnode();
1321 DShape dpsidx(n_node, DIM);
1324 dshape_eulerian(
s, psi, dpsidx);
1327 for (
unsigned i = 0;
i < DIM;
i++)
1329 for (
unsigned j = 0; j < DIM; j++)
1336 for (
unsigned i = 0;
i < DIM;
i++)
1339 unsigned u_nodal_index = u_index_nst(
i);
1341 for (
unsigned j = 0; j < DIM; j++)
1344 for (
unsigned l = 0; l < n_node; l++)
1346 dudx(
i, j) += nodal_value(l, u_nodal_index) * dpsidx(l, j);
1351 vorticity[0] = dudx(2, 1) - dudx(1, 2);
1352 vorticity[1] = dudx(0, 2) - dudx(2, 0);
1353 vorticity[2] = dudx(1, 0) - dudx(0, 1);
1365 template<
unsigned DIM>
1369 "Check the kinetic energy calculation for GeneralisedNewtonian NSt",
1370 OOMPH_CURRENT_FUNCTION,
1371 OOMPH_EXCEPTION_LOCATION);
1374 double kin_en = 0.0;
1377 unsigned n_intpt = integral_pt()->nweight();
1383 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1386 for (
unsigned i = 0;
i < DIM;
i++)
1388 s[
i] = integral_pt()->knot(ipt,
i);
1392 double w = integral_pt()->weight(ipt);
1395 double J = J_eulerian(
s);
1398 double veloc_squared = 0.0;
1399 for (
unsigned i = 0;
i < DIM;
i++)
1401 veloc_squared += interpolated_u_nst(
s,
i) * interpolated_u_nst(
s,
i);
1404 kin_en += 0.5 * veloc_squared * w * J;
1414 template<
unsigned DIM>
1418 double d_kin_en_dt = 0.0;
1421 const unsigned n_intpt = integral_pt()->nweight();
1427 const unsigned n_node = this->nnode();
1431 DShape dpsidx(n_node, DIM);
1434 unsigned u_index[DIM];
1435 for (
unsigned i = 0;
i < DIM;
i++)
1437 u_index[
i] = this->u_index_nst(
i);
1441 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1444 double J = dshape_eulerian_at_knot(ipt, psi, dpsidx);
1447 double w = integral_pt()->weight(ipt);
1450 Vector<double> interpolated_u(DIM, 0.0), interpolated_dudt(DIM, 0.0);
1453 for (
unsigned l = 0; l < n_node; l++)
1456 for (
unsigned i = 0;
i < DIM;
i++)
1458 interpolated_u[
i] += nodal_value(l, u_index[
i]) * psi(l);
1459 interpolated_dudt[
i] += du_dt_nst(l, u_index[
i]) * psi(l);
1464 if (!ALE_is_disabled)
1470 for (
unsigned l = 0; l < n_node; l++)
1472 for (
unsigned i = 0;
i < DIM;
i++)
1474 mesh_velocity[
i] += this->dnodal_position_dt(l,
i) * psi(l);
1476 for (
unsigned j = 0; j < DIM; j++)
1478 interpolated_dudx(
i, j) +=
1479 this->nodal_value(l, u_index[
i]) * dpsidx(l, j);
1485 for (
unsigned i = 0;
i < DIM;
i++)
1487 for (
unsigned k = 0; k < DIM; k++)
1489 interpolated_dudt[
i] -= mesh_velocity[k] * interpolated_dudx(
i, k);
1497 for (
unsigned i = 0;
i < DIM;
i++)
1499 sum += interpolated_u[
i] * interpolated_dudt[
i];
1502 d_kin_en_dt += sum * w * J;
1512 template<
unsigned DIM>
1517 double press_int = 0;
1520 unsigned n_intpt = integral_pt()->nweight();
1526 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1529 for (
unsigned i = 0;
i < DIM;
i++)
1531 s[
i] = integral_pt()->knot(ipt,
i);
1535 double w = integral_pt()->weight(ipt);
1538 double J = J_eulerian(
s);
1544 double press = interpolated_p_nst(
s);
1547 press_int += press *
W;
1557 template<
unsigned DIM>
1559 DIM>::max_and_min_invariant_and_viscosity(
double& min_invariant,
1560 double& max_invariant,
1561 double& min_viscosity,
1562 double& max_viscosity)
const
1565 min_invariant = DBL_MAX;
1566 max_invariant = -DBL_MAX;
1567 min_viscosity = DBL_MAX;
1568 max_viscosity = -DBL_MAX;
1571 unsigned Nintpt = integral_pt()->nweight();
1577 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
1580 for (
unsigned i = 0;
i < DIM;
i++)
s[
i] = integral_pt()->knot(ipt,
i);
1584 strain_rate(
s, strainrate);
1595 min_viscosity = std::min(min_viscosity, viscosity);
1596 max_viscosity = std::max(max_viscosity, viscosity);
1606 template<
unsigned DIM>
1614 if (ndof() == 0)
return;
1617 unsigned n_node = nnode();
1620 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
1623 unsigned n_pres = npres_nst();
1626 unsigned u_nodal_index[DIM];
1627 for (
unsigned i = 0;
i < DIM;
i++)
1629 u_nodal_index[
i] = u_index_nst(
i);
1633 Shape psif(n_node), testf(n_node);
1634 DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
1637 Shape psip(n_pres), testp(n_pres);
1640 unsigned n_intpt = integral_pt()->nweight();
1647 double scaled_re = re() * density_ratio();
1648 double scaled_re_st = re_st() * density_ratio();
1649 double scaled_re_inv_fr = re_invfr() * density_ratio();
1650 double visc_ratio = viscosity_ratio();
1654 int local_eqn = 0, local_unknown = 0;
1657 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1660 for (
unsigned i = 0;
i < DIM;
i++)
s[
i] = integral_pt()->knot(ipt,
i);
1662 double w = integral_pt()->weight(ipt);
1665 double J = dshape_and_dtest_eulerian_at_knot_nst(
1666 ipt, psif, dpsifdx, testf, dtestfdx);
1669 pshape_nst(
s, psip, testp);
1676 double interpolated_p = 0.0;
1684 for (
unsigned l = 0; l < n_pres; l++)
1685 interpolated_p += p_nst(l) * psip[l];
1690 for (
unsigned l = 0; l < n_node; l++)
1693 for (
unsigned i = 0;
i < DIM;
i++)
1696 double u_value = raw_nodal_value(l, u_nodal_index[
i]);
1697 interpolated_u[
i] += u_value * psif[l];
1698 interpolated_x[
i] += raw_nodal_position(l,
i) * psif[l];
1699 dudt[
i] += du_dt_nst(l,
i) * psif[l];
1702 for (
unsigned j = 0; j < DIM; j++)
1704 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
1709 if (!ALE_is_disabled)
1712 for (
unsigned l = 0; l < n_node; l++)
1715 for (
unsigned i = 0;
i < DIM;
i++)
1717 mesh_velocity[
i] += this->raw_dnodal_position_dt(l,
i) * psif[l];
1728 if (!Use_extrapolated_strainrate_to_compute_second_invariant)
1730 strain_rate(
s, strainrate_to_compute_second_invariant);
1734 extrapolated_strain_rate(ipt, strainrate_to_compute_second_invariant);
1739 strainrate_to_compute_second_invariant);
1746 get_body_force_nst(time, ipt,
s, interpolated_x, body_force);
1749 double source = get_source_nst(time, ipt, interpolated_x);
1755 if (!Use_extrapolated_strainrate_to_compute_second_invariant)
1758 double dviscosity_dsecond_invariant =
1763 strain_rate(
s, strainrate);
1773 for (
unsigned i = 0;
i < DIM;
i++)
1775 for (
unsigned j = 0; j < DIM; j++)
1780 kroneckerdelta(
i,
i) = 1.0;
1783 for (
unsigned k = 0; k < DIM; k++)
1787 tmp += strainrate(k, k);
1790 dinvariant_dstrainrate(
i,
i) = tmp;
1794 dinvariant_dstrainrate(
i, j) = -strainrate(j,
i);
1804 for (
unsigned l = 0; l < n_node; l++)
1807 for (
unsigned k = 0; k < DIM; k++)
1810 for (
unsigned i = 0;
i < DIM;
i++)
1812 for (
unsigned j = 0; j < DIM; j++)
1815 dstrainrate_dunknown(
i, j, k, l) = 0.0;
1818 for (
unsigned m = 0; m < DIM; m++)
1820 for (
unsigned n = 0; n < DIM; n++)
1822 dstrainrate_dunknown(
i, j, k, l) +=
1824 (kroneckerdelta(
i, m) * kroneckerdelta(j, n) +
1825 kroneckerdelta(
i, n) * kroneckerdelta(j, m)) *
1826 kroneckerdelta(m, k) * dpsifdx(l, n);
1836 for (
unsigned l = 0; l < n_node; l++)
1839 for (
unsigned k = 0; k < DIM; k++)
1842 for (
unsigned i = 0;
i < DIM;
i++)
1844 for (
unsigned j = 0; j < DIM; j++)
1846 dviscosity_dunknown(k, l) += dviscosity_dsecond_invariant *
1847 dinvariant_dstrainrate(
i, j) *
1848 dstrainrate_dunknown(
i, j, k, l);
1860 for (
unsigned l = 0; l < n_node; l++)
1863 for (
unsigned i = 0;
i < DIM;
i++)
1866 local_eqn = nodal_local_eqn(l, u_nodal_index[
i]);
1870 residuals[local_eqn] += body_force[
i] * testf[l] *
W;
1873 residuals[local_eqn] += scaled_re_inv_fr * testf[l] * G[
i] *
W;
1877 if (Pre_multiply_by_viscosity_ratio)
1879 residuals[local_eqn] +=
1880 visc_ratio * viscosity * interpolated_p * dtestfdx(l,
i) *
W;
1884 residuals[local_eqn] += interpolated_p * dtestfdx(l,
i) *
W;
1891 for (
unsigned k = 0; k < DIM; k++)
1893 residuals[local_eqn] -=
1894 visc_ratio * viscosity *
1895 (interpolated_dudx(
i, k) + Gamma[
i] * interpolated_dudx(k,
i)) *
1901 residuals[local_eqn] -= scaled_re_st * dudt[
i] * testf[l] *
W;
1905 for (
unsigned k = 0; k < DIM; k++)
1907 double tmp = scaled_re * interpolated_u[k];
1908 if (!ALE_is_disabled) tmp -= scaled_re_st * mesh_velocity[k];
1909 residuals[local_eqn] -=
1910 tmp * interpolated_dudx(
i, k) * testf[l] *
W;
1917 for (
unsigned l2 = 0; l2 < n_node; l2++)
1920 for (
unsigned i2 = 0; i2 < DIM; i2++)
1923 local_unknown = nodal_local_eqn(l2, u_nodal_index[i2]);
1924 if (local_unknown >= 0)
1927 jacobian(local_eqn, local_unknown) -=
1928 visc_ratio * viscosity * Gamma[
i] * dpsifdx(l2,
i) *
1929 dtestfdx(l, i2) *
W;
1935 for (
unsigned k = 0; k < DIM; k++)
1937 jacobian(local_eqn, local_unknown) -=
1938 visc_ratio * viscosity * dpsifdx(l2, k) *
1944 !Use_extrapolated_strainrate_to_compute_second_invariant)
1946 for (
unsigned k = 0; k < DIM; k++)
1948 jacobian(local_eqn, local_unknown) -=
1949 visc_ratio * dviscosity_dunknown(i2, l2) *
1950 (interpolated_dudx(
i, k) +
1951 Gamma[
i] * interpolated_dudx(k,
i)) *
1957 jacobian(local_eqn, local_unknown) -=
1958 scaled_re * psif[l2] * interpolated_dudx(
i, i2) *
1970 mass_matrix(local_eqn, local_unknown) +=
1971 scaled_re_st * psif[l2] * testf[l] *
W;
1975 jacobian(local_eqn, local_unknown) -=
1977 node_pt(l2)->time_stepper_pt()->weight(1, 0) *
1978 psif[l2] * testf[l] *
W;
1981 for (
unsigned k = 0; k < DIM; k++)
1983 double tmp = scaled_re * interpolated_u[k];
1984 if (!ALE_is_disabled)
1985 tmp -= scaled_re_st * mesh_velocity[k];
1986 jacobian(local_eqn, local_unknown) -=
1987 tmp * dpsifdx(l2, k) * testf[l] *
W;
1996 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1999 local_unknown = p_local_eqn(l2);
2000 if (local_unknown >= 0)
2002 if (Pre_multiply_by_viscosity_ratio)
2004 jacobian(local_eqn, local_unknown) +=
2005 visc_ratio * viscosity * psip[l2] * dtestfdx(l,
i) *
W;
2009 jacobian(local_eqn, local_unknown) +=
2010 psip[l2] * dtestfdx(l,
i) *
W;
2026 for (
unsigned l = 0; l < n_pres; l++)
2028 local_eqn = p_local_eqn(l);
2034 double aux = -source;
2037 for (
unsigned k = 0; k < DIM; k++)
2040 aux += interpolated_dudx(k, k);
2044 if (Pre_multiply_by_viscosity_ratio)
2046 residuals[local_eqn] += visc_ratio * viscosity * aux * testp[l] *
W;
2050 residuals[local_eqn] += aux * testp[l] *
W;
2057 for (
unsigned l2 = 0; l2 < n_node; l2++)
2060 for (
unsigned i2 = 0; i2 < DIM; i2++)
2063 local_unknown = nodal_local_eqn(l2, u_nodal_index[i2]);
2064 if (local_unknown >= 0)
2066 if (Pre_multiply_by_viscosity_ratio)
2068 jacobian(local_eqn, local_unknown) +=
2069 visc_ratio * viscosity * dpsifdx(l2, i2) * testp[l] *
W;
2073 jacobian(local_eqn, local_unknown) +=
2074 dpsifdx(l2, i2) * testp[l] *
W;
2092 template<
unsigned DIM>
2095 double*
const& parameter_pt,
2102 OOMPH_CURRENT_FUNCTION,
2103 OOMPH_EXCEPTION_LOCATION);
2110 template<
unsigned DIM>
2118 OOMPH_CURRENT_FUNCTION,
2119 OOMPH_EXCEPTION_LOCATION);
2129 template<
unsigned DIM>
2132 dresidual_dnodal_coordinates)
2141 const unsigned n_node = nnode();
2144 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
2147 const unsigned n_pres = npres_nst();
2150 unsigned u_nodal_index[DIM];
2151 for (
unsigned i = 0;
i < DIM;
i++)
2153 u_nodal_index[
i] = u_index_nst(
i);
2157 Shape psif(n_node), testf(n_node);
2158 DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
2161 Shape psip(n_pres), testp(n_pres);
2179 const unsigned n_intpt = integral_pt()->nweight();
2186 double scaled_re = re() * density_ratio();
2187 double scaled_re_st = re_st() * density_ratio();
2188 double scaled_re_inv_fr = re_invfr() * density_ratio();
2189 double visc_ratio = viscosity_ratio();
2198 bool element_has_node_with_aux_node_update_fct =
false;
2199 for (
unsigned q = 0; q < n_node; q++)
2201 Node* nod_pt = node_pt(q);
2206 element_has_node_with_aux_node_update_fct =
true;
2210 for (
unsigned i = 0;
i < DIM;
i++)
2212 u_ref[
i] = *(nod_pt->
value_pt(u_nodal_index[
i]));
2216 for (
unsigned p = 0; p < DIM; p++)
2219 double backup = nod_pt->
x(p);
2223 nod_pt->
x(p) += eps_fd;
2230 (*(nod_pt->
value_pt(u_nodal_index[p])) - u_ref[p]) / eps_fd;
2233 nod_pt->
x(p) = backup;
2245 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
2248 for (
unsigned i = 0;
i < DIM;
i++)
2250 s[
i] = integral_pt()->knot(ipt,
i);
2254 const double w = integral_pt()->weight(ipt);
2257 const double J = dshape_and_dtest_eulerian_at_knot_nst(ipt,
2267 pshape_nst(
s, psip, testp);
2271 double interpolated_p = 0.0;
2279 for (
unsigned l = 0; l < n_pres; l++)
2281 interpolated_p += p_nst(l) * psip[l];
2287 for (
unsigned l = 0; l < n_node; l++)
2290 for (
unsigned i = 0;
i < DIM;
i++)
2293 double u_value = raw_nodal_value(l, u_nodal_index[
i]);
2294 interpolated_u[
i] += u_value * psif[l];
2295 interpolated_x[
i] += raw_nodal_position(l,
i) * psif[l];
2296 dudt[
i] += du_dt_nst(l,
i) * psif[l];
2299 for (
unsigned j = 0; j < DIM; j++)
2301 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
2306 if (!ALE_is_disabled)
2309 for (
unsigned l = 0; l < n_node; l++)
2312 for (
unsigned i = 0;
i < DIM;
i++)
2314 mesh_velocity[
i] += this->raw_dnodal_position_dt(l,
i) * psif[l];
2320 for (
unsigned q = 0; q < n_node; q++)
2323 for (
unsigned p = 0; p < DIM; p++)
2325 for (
unsigned i = 0;
i < DIM;
i++)
2327 for (
unsigned k = 0; k < DIM; k++)
2330 for (
unsigned j = 0; j < n_node; j++)
2332 aux += raw_nodal_value(j, u_nodal_index[
i]) *
2333 d_dpsifdx_dX(p, q, j, k);
2335 d_dudx_dX(p, q,
i, k) = aux;
2343 const double pos_time_weight =
2344 node_pt(0)->position_time_stepper_pt()->weight(1, 0);
2345 const double val_time_weight =
2346 node_pt(0)->time_stepper_pt()->weight(1, 0);
2350 get_body_force_nst(time, ipt,
s, interpolated_x, body_force);
2353 const double source = get_source_nst(time, ipt, interpolated_x);
2360 get_body_force_gradient_nst(
2361 time, ipt,
s, interpolated_x, d_body_force_dx);
2365 get_source_gradient_nst(time, ipt, interpolated_x, source_gradient);
2375 for (
unsigned l = 0; l < n_node; l++)
2378 for (
unsigned i = 0;
i < DIM;
i++)
2381 local_eqn = nodal_local_eqn(l, u_nodal_index[
i]);
2388 for (
unsigned p = 0; p < DIM; p++)
2391 for (
unsigned q = 0; q < n_node; q++)
2397 double sum = body_force[
i] * testf[l];
2400 sum += scaled_re_inv_fr * testf[l] * G[
i];
2403 sum += interpolated_p * dtestfdx(l,
i);
2409 for (
unsigned k = 0; k < DIM; k++)
2412 (interpolated_dudx(
i, k) +
2413 Gamma[
i] * interpolated_dudx(k,
i)) *
2420 sum -= scaled_re_st * dudt[
i] * testf[l];
2423 for (
unsigned k = 0; k < DIM; k++)
2425 double tmp = scaled_re * interpolated_u[k];
2426 if (!ALE_is_disabled)
2428 tmp -= scaled_re_st * mesh_velocity[k];
2430 sum -= tmp * interpolated_dudx(
i, k) * testf[l];
2434 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2435 sum * dJ_dX(p, q) * w;
2441 sum = d_body_force_dx(
i, p) * psif(q) * testf(l);
2444 sum += interpolated_p * d_dtestfdx_dX(p, q, l,
i);
2447 for (
unsigned k = 0; k < DIM; k++)
2449 sum -= visc_ratio * ((interpolated_dudx(
i, k) +
2450 Gamma[
i] * interpolated_dudx(k,
i)) *
2451 d_dtestfdx_dX(p, q, l, k) +
2452 (d_dudx_dX(p, q,
i, k) +
2453 Gamma[
i] * d_dudx_dX(p, q, k,
i)) *
2458 for (
unsigned k = 0; k < DIM; k++)
2460 double tmp = scaled_re * interpolated_u[k];
2461 if (!ALE_is_disabled)
2463 tmp -= scaled_re_st * mesh_velocity[k];
2465 sum -= tmp * d_dudx_dX(p, q,
i, k) * testf(l);
2467 if (!ALE_is_disabled)
2469 sum += scaled_re_st * pos_time_weight * psif(q) *
2470 interpolated_dudx(
i, p) * testf(l);
2474 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
2478 if (element_has_node_with_aux_node_update_fct)
2481 -visc_ratio * Gamma[
i] * dpsifdx(q,
i) * dtestfdx(l, p) -
2482 scaled_re * psif(q) * interpolated_dudx(
i, p) * testf(l);
2485 sum -= scaled_re_st * val_time_weight * psif(q) * testf(l);
2486 for (
unsigned k = 0; k < DIM; k++)
2488 sum -= visc_ratio * dpsifdx(q, k) * dtestfdx(l, k);
2489 double tmp = scaled_re * interpolated_u[k];
2490 if (!ALE_is_disabled)
2491 tmp -= scaled_re_st * mesh_velocity[k];
2492 sum -= tmp * dpsifdx(q, k) * testf(l);
2495 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2496 sum * d_U_dX(p, q) * J * w;
2509 for (
unsigned l = 0; l < n_pres; l++)
2511 local_eqn = p_local_eqn(l);
2517 for (
unsigned p = 0; p < DIM; p++)
2520 for (
unsigned q = 0; q < n_node; q++)
2526 double aux = -source;
2529 for (
unsigned k = 0; k < DIM; k++)
2531 aux += interpolated_dudx(k, k);
2535 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2536 aux * dJ_dX(p, q) * testp[l] * w;
2542 aux = -source_gradient[p] * psif(q);
2543 for (
unsigned k = 0; k < DIM; k++)
2545 aux += d_dudx_dX(p, q, k, k);
2548 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2549 aux * testp[l] * J * w;
2553 if (element_has_node_with_aux_node_update_fct)
2555 aux = dpsifdx(q, p) * testp(l);
2556 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2557 aux * d_U_dX(p, q) * J * w;
2576 2, 2, 2, 2, 2, 2, 2, 2, 2};
2583 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2584 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
2590 template<
unsigned DIM>
2592 const unsigned& n)
const
2594 return Initial_Nvalue[n];
2607 template<
unsigned DIM>
2609 std::set<std::pair<Data*, unsigned>>& paired_load_data)
2612 unsigned u_index[DIM];
2613 for (
unsigned i = 0;
i < DIM;
i++)
2615 u_index[
i] = this->u_index_nst(
i);
2619 unsigned n_node = this->nnode();
2620 for (
unsigned n = 0; n < n_node; n++)
2624 for (
unsigned i = 0;
i < DIM;
i++)
2626 paired_load_data.insert(std::make_pair(this->node_pt(n), u_index[
i]));
2631 identify_pressure_data(paired_load_data);
2644 template<
unsigned DIM>
2646 std::set<std::pair<Data*, unsigned>>& paired_pressure_data)
2649 unsigned n_internal = this->ninternal_data();
2650 for (
unsigned l = 0; l < n_internal; l++)
2652 unsigned nval = this->internal_data_pt(l)->nvalue();
2654 for (
unsigned j = 0; j < nval; j++)
2656 paired_pressure_data.insert(
2657 std::make_pair(this->internal_data_pt(l), j));
2671 template<
unsigned DIM>
2674 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
2677 unsigned n_node = this->nnode();
2680 unsigned n_press = this->npres_nst();
2683 std::pair<unsigned, unsigned> dof_lookup;
2686 unsigned pressure_dof_number = DIM;
2689 for (
unsigned n = 0; n < n_press; n++)
2692 int local_eqn_number = this->p_local_eqn(n);
2697 if (local_eqn_number >= 0)
2701 dof_lookup.first = this->eqn_number(local_eqn_number);
2702 dof_lookup.second = pressure_dof_number;
2705 dof_lookup_list.push_front(dof_lookup);
2710 for (
unsigned n = 0; n < n_node; n++)
2713 unsigned nv = this->node_pt(n)->nvalue();
2716 for (
unsigned v = 0; v < nv; v++)
2719 int local_eqn_number = this->nodal_local_eqn(n, v);
2722 if (local_eqn_number >= 0)
2726 dof_lookup.first = this->eqn_number(local_eqn_number);
2727 dof_lookup.second = v;
2730 dof_lookup_list.push_front(dof_lookup);
2746 {3, 2, 3, 2, 2, 2, 3, 2, 3};
2757 {4, 3, 4, 3, 3, 3, 4, 3, 4, 3, 3, 3, 3, 3,
2758 3, 3, 3, 3, 4, 3, 4, 3, 3, 3, 4, 3, 4};
2763 0, 2, 6, 8, 18, 20, 24, 26};
2774 template<
unsigned DIM>
2776 std::set<std::pair<Data*, unsigned>>& paired_load_data)
2779 unsigned u_index[DIM];
2780 for (
unsigned i = 0;
i < DIM;
i++)
2782 u_index[
i] = this->u_index_nst(
i);
2786 unsigned n_node = this->nnode();
2787 for (
unsigned n = 0; n < n_node; n++)
2791 for (
unsigned i = 0;
i < DIM;
i++)
2793 paired_load_data.insert(std::make_pair(this->node_pt(n), u_index[
i]));
2798 this->identify_pressure_data(paired_load_data);
2810 template<
unsigned DIM>
2812 std::set<std::pair<Data*, unsigned>>& paired_pressure_data)
2815 unsigned p_index =
static_cast<unsigned>(this->p_nodal_index_nst());
2818 unsigned n_pres = npres_nst();
2819 for (
unsigned l = 0; l < n_pres; l++)
2823 paired_pressure_data.insert(
2824 std::make_pair(this->node_pt(Pconv[l]), p_index));
2837 template<
unsigned DIM>
2840 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
2843 unsigned n_node = this->nnode();
2849 std::pair<unsigned, unsigned> dof_lookup;
2852 for (
unsigned n = 0; n < n_node; n++)
2855 unsigned nv = this->required_nvalue(n);
2858 for (
unsigned v = 0; v < nv; v++)
2861 int local_eqn_number = this->nodal_local_eqn(n, v);
2866 if (local_eqn_number >= 0)
2870 dof_lookup.first = this->eqn_number(local_eqn_number);
2873 dof_lookup.second = v;
2876 dof_lookup_list.push_front(dof_lookup);
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
unsigned long nrow() const
Return the number of rows of the matrix.
unsigned long ncol() const
Return the number of columns of the matrix.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution specified via function pointer at a given number of plot points....
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
virtual void fill_in_generic_residual_contribution_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations. Flag=1 (or 0): do (or don't) compute the Jacob...
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
Compute traction (on the viscous scale) exerted onto the fluid at local coordinate s....
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i)
double pressure_integral() const
Integral of pressure over element.
virtual void extrapolated_strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Extrapolated strain-rate tensor: 1/2 (du_i/dx_j + du_j/dx_i) based on the previous time steps evaluat...
void full_output(std::ostream &outfile)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format....
double dissipation() const
Return integral of dissipation over element.
void get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed,...
void output_vorticity(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z], [omega_x,omega_y,[and/or omega_z]] in tecplot format. nplot points in each ...
void get_vorticity(const Vector< double > &s, Vector< double > &vorticity) const
Compute the vorticity vector at local coordinate s.
double d_kin_energy_dt() const
Get integral of time derivative of kinetic energy over element.
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
virtual void fill_in_generic_dresidual_contribution_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, unsigned flag)
Compute the derivatives of the residuals for the Navier–Stokes equations with respect to a parameter ...
double kin_energy() const
Get integral of kinetic energy over element.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution at given time Solution is provided via function pointer....
void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Compute the hessian tensor vector products required to perform continuation of bifurcations analytica...
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: x,y,[z],u,v,[w] in tecplot format. nplot points in each coordinate direction at time...
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Add to the set paired_load_data pairs containing.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n.
void identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
/////////////////////////////////////////////////////////////////////////
void identify_pressure_data(std::set< std::pair< Data *, unsigned >> &paired_pressure_data)
Add to the set paired_pressure_data pairs containing.
void identify_load_data(std::set< std::pair< Data *, unsigned >> &paired_load_data)
Add to the set paired_load_data pairs containing.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
void perform_auxiliary_node_update_fct()
Execute auxiliary update function (if any) – this can be used to update any nodal values following th...
bool has_auxiliary_node_update_fct_pt()
Boolean to indicate if node has a pointer to and auxiliary update function.
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & dt(const unsigned &t=0)
Return the value of the t-th stored timestep (t=0: present; t>0: previous).
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
double Default_Physical_Constant_Value
Default value for physical constants.
void shape(const double &s, double *Psi)
Definition for 1D Lagrange shape functions. The value of all the shape functions at the local coordin...
double second_invariant(const DenseMatrix< double > &tensor)
Compute second invariant of tensor.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...