45 double LinearisedAxisymmetricNavierStokesEquations::
46 Default_Physical_Constant_Value = 0.0;
49 int LinearisedAxisymmetricNavierStokesEquations::
50 Default_Azimuthal_Mode_Number_Value = 0;
65 std::ostream& outfile,
const unsigned& nplot,
const unsigned&
t)
68 const unsigned n_node =
nnode();
86 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
95 for (
unsigned i = 0;
i < 2;
i++)
101 for (
unsigned l = 0; l < n_node; l++)
108 for (
unsigned i = 0;
i < 6;
i++)
114 interpolated_u[
i] = 0.0;
117 for (
unsigned l = 0; l < n_node; l++)
119 interpolated_u[
i] +=
nodal_value(
t, l, u_nodal_index) * psi[l];
124 for (
unsigned i = 0;
i < 2;
i++)
130 for (
unsigned i = 0;
i < 6;
i++)
132 outfile << interpolated_u[
i] <<
" ";
135 outfile << std::endl;
151 std::ostream& outfile,
const unsigned& nplot)
163 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
169 for (
unsigned i = 0;
i < 2;
i++)
175 for (
unsigned i = 0;
i < 6;
i++)
181 for (
unsigned i = 0;
i < 2;
i++)
186 outfile << std::endl;
188 outfile << std::endl;
202 FILE* file_pt,
const unsigned& nplot)
214 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
220 for (
unsigned i = 0;
i < 2;
i++)
226 for (
unsigned i = 0;
i < 6;
i++)
232 for (
unsigned i = 0;
i < 2;
i++)
237 fprintf(file_pt,
"\n");
240 fprintf(file_pt,
"\n");
259 if ((strainrate.
ncol() != 3) || (strainrate.
nrow() != 3))
261 std::ostringstream error_message;
262 error_message <<
"The strain rate has incorrect dimensions "
263 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
264 <<
" Not 3" << std::endl;
268 "LinearisedAxisymmetricNavierStokeEquations::strain_rate()",
269 OOMPH_EXCEPTION_LOCATION);
274 const unsigned n_node =
nnode();
284 double interpolated_r = 0.0;
287 double UC = 0.0, US = 0.0;
288 double dUCdr = 0.0, dUSdr = 0.0;
289 double dUCdz = 0.0, dUSdz = 0.0;
290 double WC = 0.0, WS = 0.0;
291 double dWCdr = 0.0, dWSdr = 0.0;
292 double dWCdz = 0.0, dWSdz = 0.0;
293 double VC = 0.0, VS = 0.0;
294 double dVCdr = 0.0, dVSdr = 0.0;
295 double dVCdz = 0.0, dVSdz = 0.0;
298 unsigned u_nodal_index[6];
299 for (
unsigned i = 0;
i < 6; ++
i)
306 for (
unsigned l = 0; l < n_node; l++)
317 dUCdr +=
nodal_value(l, u_nodal_index[0]) * dpsidx(l, 0);
318 dUSdr +=
nodal_value(l, u_nodal_index[1]) * dpsidx(l, 0);
319 dWCdr +=
nodal_value(l, u_nodal_index[2]) * dpsidx(l, 0);
320 dWSdr +=
nodal_value(l, u_nodal_index[3]) * dpsidx(l, 0);
321 dVCdr +=
nodal_value(l, u_nodal_index[4]) * dpsidx(l, 0);
322 dVSdr +=
nodal_value(l, u_nodal_index[5]) * dpsidx(l, 0);
324 dUCdz +=
nodal_value(l, u_nodal_index[0]) * dpsidx(l, 1);
325 dUSdz +=
nodal_value(l, u_nodal_index[1]) * dpsidx(l, 1);
326 dWCdz +=
nodal_value(l, u_nodal_index[2]) * dpsidx(l, 1);
327 dWSdz +=
nodal_value(l, u_nodal_index[3]) * dpsidx(l, 1);
328 dVCdz +=
nodal_value(l, u_nodal_index[4]) * dpsidx(l, 1);
329 dVSdz +=
nodal_value(l, u_nodal_index[5]) * dpsidx(l, 1);
339 const double cosktheta = 1.0 / sqrt(2);
340 const double sinktheta = cosktheta;
344 const double ur = UC * cosktheta + US * sinktheta;
345 const double utheta = VC * cosktheta + VS * sinktheta;
347 const double durdr = dUCdr * cosktheta + dUSdr * sinktheta;
348 const double durdz = dUCdz * cosktheta + dUSdz * sinktheta;
349 const double durdtheta = k * US * cosktheta - k * UC * sinktheta;
351 const double duzdr = dWCdr * cosktheta + dWSdr * sinktheta;
352 const double duzdz = dWCdz * cosktheta + dWSdz * sinktheta;
353 const double duzdtheta = k * WS * cosktheta - k * WC * sinktheta;
355 const double duthetadr = dVCdr * cosktheta + dVSdr * sinktheta;
356 const double duthetadz = dVCdz * cosktheta + dVSdz * sinktheta;
357 const double duthetadtheta = k * VS * cosktheta - k * VC * sinktheta;
361 strainrate(0, 0) = durdr;
362 strainrate(0, 1) = 0.5 * (durdz + duzdr);
363 strainrate(1, 0) = strainrate(0, 1);
364 strainrate(0, 2) = 0.5 * duthetadr;
365 strainrate(2, 0) = strainrate(0, 2);
366 strainrate(1, 1) = duzdz;
367 strainrate(1, 2) = 0.5 * duthetadz;
368 strainrate(2, 1) = strainrate(1, 2);
369 strainrate(2, 2) = 0.0;
373 if (std::abs(interpolated_r) > 1.0e-16)
375 double inverse_radius = 1.0 / interpolated_r;
377 0.5 * (duthetadr + inverse_radius * (durdtheta - utheta));
378 strainrate(2, 0) = strainrate(0, 2);
379 strainrate(2, 2) = inverse_radius * (ur + duthetadtheta);
380 strainrate(1, 2) = 0.5 * (duthetadz + inverse_radius * duzdtheta);
381 strainrate(2, 1) = strainrate(1, 2);
402 const unsigned n_node =
nnode();
409 unsigned u_nodal_index[6];
410 for (
unsigned i = 0;
i < 6; ++
i)
417 Shape psif(n_node), testf(n_node);
418 DShape dpsifdx(n_node, 2), dtestfdx(n_node, 2);
421 Shape psip(n_pres), testp(n_pres);
437 int local_eqn = 0, local_unknown = 0;
440 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
443 for (
unsigned i = 0;
i < 2;
i++)
454 ipt, psif, dpsifdx, testf, dtestfdx);
461 const double W = w * J;
485 for (
unsigned l = 0; l < n_pres; l++)
488 const double psip_ = psip(l);
491 for (
unsigned i = 0;
i < 2;
i++)
497 interpolated_p[
i] += p_value * psip_;
505 for (
unsigned l = 0; l < n_node; l++)
508 const double psif_ = psif(l);
511 for (
unsigned i = 0;
i < 2;
i++)
517 for (
unsigned i = 0;
i < 6;
i++)
523 interpolated_u[
i] += u_value * psif_;
529 for (
unsigned j = 0; j < 2; j++)
531 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
540 for (
unsigned l = 0; l < n_node; l++)
543 for (
unsigned i = 0;
i < 2;
i++)
572 const double interpolated_ur = base_flow_u[0];
573 const double interpolated_uz = base_flow_u[1];
574 const double interpolated_utheta = base_flow_u[2];
575 const double interpolated_durdr = base_flow_dudx(0, 0);
576 const double interpolated_durdz = base_flow_dudx(0, 1);
577 const double interpolated_duzdr = base_flow_dudx(1, 0);
578 const double interpolated_duzdz = base_flow_dudx(1, 1);
579 const double interpolated_duthetadr = base_flow_dudx(2, 0);
580 const double interpolated_duthetadz = base_flow_dudx(2, 1);
586 const double interpolated_UC = interpolated_u[0];
587 const double interpolated_US = interpolated_u[1];
588 const double interpolated_WC = interpolated_u[2];
589 const double interpolated_WS = interpolated_u[3];
590 const double interpolated_VC = interpolated_u[4];
591 const double interpolated_VS = interpolated_u[5];
592 const double interpolated_PC = interpolated_p[0];
593 const double interpolated_PS = interpolated_p[1];
596 const double interpolated_dUCdr = interpolated_dudx(0, 0);
597 const double interpolated_dUCdz = interpolated_dudx(0, 1);
598 const double interpolated_dUSdr = interpolated_dudx(1, 0);
599 const double interpolated_dUSdz = interpolated_dudx(1, 1);
600 const double interpolated_dWCdr = interpolated_dudx(2, 0);
601 const double interpolated_dWCdz = interpolated_dudx(2, 1);
602 const double interpolated_dWSdr = interpolated_dudx(3, 0);
603 const double interpolated_dWSdz = interpolated_dudx(3, 1);
604 const double interpolated_dVCdr = interpolated_dudx(4, 0);
605 const double interpolated_dVCdz = interpolated_dudx(4, 1);
606 const double interpolated_dVSdr = interpolated_dudx(5, 0);
607 const double interpolated_dVSdz = interpolated_dudx(5, 1);
614 for (
unsigned l = 0; l < n_node; l++)
617 const double testf_ = testf(l);
618 const double dtestfdr = dtestfdx(l, 0);
619 const double dtestfdz = dtestfdx(l, 1);
632 residuals[local_eqn] += interpolated_PC * (testf_ + r * dtestfdr) *
W;
635 residuals[local_eqn] -= visc_ratio * r * (1.0 +
Gamma[0]) *
636 interpolated_dUCdr * dtestfdr *
W;
638 residuals[local_eqn] -=
640 (interpolated_dUCdz +
Gamma[0] * interpolated_dWCdr) * dtestfdz *
W;
642 residuals[local_eqn] +=
644 ((k *
Gamma[0] * interpolated_dVSdr) -
645 (k * (2.0 +
Gamma[0]) * interpolated_VS / r) -
646 ((1.0 +
Gamma[0] + (k * k)) * interpolated_UC / r)) *
650 residuals[local_eqn] -= scaled_re_st * r * dudt[0] * testf_ *
W;
653 residuals[local_eqn] -= scaled_re *
654 (r * interpolated_ur * interpolated_dUCdr +
655 r * interpolated_durdr * interpolated_UC +
656 k * interpolated_utheta * interpolated_US -
657 2 * interpolated_utheta * interpolated_VC +
658 r * interpolated_uz * interpolated_dUCdz +
659 r * interpolated_durdz * interpolated_WC) *
665 for (
unsigned j = 0; j < 2; j++)
667 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[j] *
668 interpolated_dudx(0, j) * testf_ *
W;
678 for (
unsigned l2 = 0; l2 < n_node; l2++)
681 const double psif_ = psif[l2];
682 const double dpsifdr = dpsifdx(l2, 0);
683 const double dpsifdz = dpsifdx(l2, 1);
687 if (local_unknown >= 0)
692 mass_matrix(local_eqn, local_unknown) +=
693 scaled_re_st * r * psif_ * testf_ *
W;
699 jacobian(local_eqn, local_unknown) -=
700 visc_ratio * r * (1.0 +
Gamma[0]) * dpsifdr * dtestfdr *
W;
702 jacobian(local_eqn, local_unknown) -=
703 visc_ratio * r * dpsifdz * dtestfdz *
W;
705 jacobian(local_eqn, local_unknown) -=
706 visc_ratio * (1.0 +
Gamma[0] + (k * k)) * psif_ * testf_ *
W /
710 jacobian(local_eqn, local_unknown) -=
716 jacobian(local_eqn, local_unknown) -=
718 (psif_ * interpolated_durdr + interpolated_ur * dpsifdr +
719 interpolated_uz * dpsifdz) *
725 for (
unsigned j = 0; j < 2; j++)
727 jacobian(local_eqn, local_unknown) +=
728 scaled_re_st * r * mesh_velocity[j] * dpsifdx(l2, j) *
736 if (local_unknown >= 0)
739 jacobian(local_eqn, local_unknown) -=
740 scaled_re * k * interpolated_utheta * psif_ * testf_ *
W;
745 if (local_unknown >= 0)
748 jacobian(local_eqn, local_unknown) -=
749 visc_ratio *
Gamma[0] * r * dpsifdr * dtestfdz *
W;
752 jacobian(local_eqn, local_unknown) -=
753 scaled_re * r * interpolated_durdz * psif_ * testf_ *
W;
761 if (local_unknown >= 0)
764 jacobian(local_eqn, local_unknown) +=
765 scaled_re * 2 * interpolated_utheta * psif_ * testf_ *
W;
770 if (local_unknown >= 0)
773 jacobian(local_eqn, local_unknown) +=
775 ((
Gamma[0] * k * dpsifdr) -
776 (k * (2.0 +
Gamma[0]) * psif_ / r)) *
783 for (
unsigned l2 = 0; l2 < n_pres; l2++)
787 if (local_unknown >= 0)
789 jacobian(local_eqn, local_unknown) +=
790 psip[l2] * (testf_ + r * dtestfdr) *
W;
811 residuals[local_eqn] += interpolated_PS * (testf_ + r * dtestfdr) *
W;
814 residuals[local_eqn] -= visc_ratio * r * (1.0 +
Gamma[0]) *
815 interpolated_dUSdr * dtestfdr *
W;
817 residuals[local_eqn] -=
819 (interpolated_dUSdz +
Gamma[0] * interpolated_dWSdr) * dtestfdz *
W;
821 residuals[local_eqn] -=
823 ((k *
Gamma[0] * interpolated_dVCdr) -
824 (k * (2.0 +
Gamma[0]) * interpolated_VC / r) +
825 ((1.0 +
Gamma[0] + (k * k)) * interpolated_US / r)) *
829 residuals[local_eqn] -= scaled_re_st * r * dudt[1] * testf_ *
W;
832 residuals[local_eqn] -= scaled_re *
833 (r * interpolated_ur * interpolated_dUSdr +
834 r * interpolated_durdr * interpolated_US -
835 k * interpolated_utheta * interpolated_UC -
836 2 * interpolated_utheta * interpolated_VS +
837 r * interpolated_uz * interpolated_dUSdz +
838 r * interpolated_durdz * interpolated_WS) *
844 for (
unsigned j = 0; j < 2; j++)
846 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[j] *
847 interpolated_dudx(1, j) * testf_ *
W;
857 for (
unsigned l2 = 0; l2 < n_node; l2++)
860 const double psif_ = psif[l2];
861 const double dpsifdr = dpsifdx(l2, 0);
862 const double dpsifdz = dpsifdx(l2, 1);
866 if (local_unknown >= 0)
869 jacobian(local_eqn, local_unknown) +=
870 scaled_re * k * interpolated_utheta * psif_ * testf_ *
W;
875 if (local_unknown >= 0)
880 mass_matrix(local_eqn, local_unknown) +=
881 scaled_re_st * r * psif_ * testf_ *
W;
887 jacobian(local_eqn, local_unknown) -=
888 visc_ratio * r * (1.0 +
Gamma[0]) * dpsifdr * dtestfdr *
W;
890 jacobian(local_eqn, local_unknown) -=
891 visc_ratio * r * dpsifdz * dtestfdz *
W;
893 jacobian(local_eqn, local_unknown) -=
894 visc_ratio * (1.0 +
Gamma[0] + (k * k)) * psif_ * testf_ *
W /
898 jacobian(local_eqn, local_unknown) -=
904 jacobian(local_eqn, local_unknown) -=
906 (psif_ * interpolated_durdr + interpolated_ur * dpsifdr +
907 interpolated_uz * dpsifdz) *
913 for (
unsigned j = 0; j < 2; j++)
915 jacobian(local_eqn, local_unknown) +=
916 scaled_re_st * r * mesh_velocity[j] * dpsifdx(l2, j) *
927 if (local_unknown >= 0)
930 jacobian(local_eqn, local_unknown) -=
931 visc_ratio *
Gamma[0] * r * dpsifdr * dtestfdz *
W;
934 jacobian(local_eqn, local_unknown) -=
935 scaled_re * r * interpolated_durdz * psif_ * testf_ *
W;
940 if (local_unknown >= 0)
943 jacobian(local_eqn, local_unknown) -=
945 ((
Gamma[0] * k * dpsifdr) -
946 (k * (2.0 +
Gamma[0]) * psif_ / r)) *
952 if (local_unknown >= 0)
955 jacobian(local_eqn, local_unknown) +=
956 scaled_re * 2 * interpolated_utheta * psif_ * testf_ *
W;
962 for (
unsigned l2 = 0; l2 < n_pres; l2++)
968 if (local_unknown >= 0)
970 jacobian(local_eqn, local_unknown) +=
971 psip[l2] * (testf_ + r * dtestfdr) *
W;
989 residuals[local_eqn] += r * interpolated_PC * dtestfdz *
W;
992 residuals[local_eqn] -=
994 (interpolated_dWCdr +
Gamma[1] * interpolated_dUCdz) * dtestfdr *
W;
996 residuals[local_eqn] -= visc_ratio * r * (1.0 +
Gamma[1]) *
997 interpolated_dWCdz * dtestfdz *
W;
999 residuals[local_eqn] +=
1001 (
Gamma[1] * interpolated_dVSdz - k * interpolated_WC / r) * testf_ *
1005 residuals[local_eqn] -= scaled_re_st * r * dudt[2] * testf_ *
W;
1008 residuals[local_eqn] -= scaled_re *
1009 (r * interpolated_ur * interpolated_dWCdr +
1010 r * interpolated_duzdr * interpolated_UC +
1011 k * interpolated_utheta * interpolated_WS +
1012 r * interpolated_uz * interpolated_dWCdz +
1013 r * interpolated_duzdz * interpolated_WC) *
1019 for (
unsigned j = 0; j < 2; j++)
1021 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[j] *
1022 interpolated_dudx(2, j) * testf_ *
W;
1032 for (
unsigned l2 = 0; l2 < n_node; l2++)
1035 const double psif_ = psif[l2];
1036 const double dpsifdr = dpsifdx(l2, 0);
1037 const double dpsifdz = dpsifdx(l2, 1);
1041 if (local_unknown >= 0)
1044 jacobian(local_eqn, local_unknown) -=
1045 visc_ratio * r *
Gamma[1] * dpsifdz * dtestfdr *
W;
1048 jacobian(local_eqn, local_unknown) -=
1049 scaled_re * r * psif_ * interpolated_duzdr * testf_ *
W;
1057 if (local_unknown >= 0)
1062 mass_matrix(local_eqn, local_unknown) +=
1063 scaled_re_st * r * psif_ * testf_ *
W;
1069 jacobian(local_eqn, local_unknown) -=
1070 visc_ratio * r * dpsifdr * dtestfdr *
W;
1072 jacobian(local_eqn, local_unknown) -=
1073 visc_ratio * r * (1.0 +
Gamma[1]) * dpsifdz * dtestfdz *
W;
1075 jacobian(local_eqn, local_unknown) -=
1076 visc_ratio * k * k * psif_ * testf_ *
W / r;
1079 jacobian(local_eqn, local_unknown) -=
1085 jacobian(local_eqn, local_unknown) -=
1087 (interpolated_ur * dpsifdr + psif_ * interpolated_duzdz +
1088 interpolated_uz * dpsifdz) *
1095 for (
unsigned j = 0; j < 2; j++)
1097 jacobian(local_eqn, local_unknown) +=
1098 scaled_re_st * r * mesh_velocity[j] * dpsifdx(l2, j) *
1106 if (local_unknown >= 0)
1109 jacobian(local_eqn, local_unknown) -=
1110 scaled_re * k * interpolated_utheta * psif_ * testf_ *
W;
1118 if (local_unknown >= 0)
1121 jacobian(local_eqn, local_unknown) +=
1122 visc_ratio *
Gamma[1] * k * dpsifdz * testf_ *
W;
1128 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1132 if (local_unknown >= 0)
1134 jacobian(local_eqn, local_unknown) +=
1135 r * psip[l2] * dtestfdz *
W;
1156 residuals[local_eqn] += r * interpolated_PS * dtestfdz *
W;
1159 residuals[local_eqn] -=
1161 (interpolated_dWSdr +
Gamma[1] * interpolated_dUSdz) * dtestfdr *
W;
1163 residuals[local_eqn] -= visc_ratio * r * (1.0 +
Gamma[1]) *
1164 interpolated_dWSdz * dtestfdz *
W;
1166 residuals[local_eqn] -=
1168 (
Gamma[1] * interpolated_dVCdz + k * interpolated_WS / r) * testf_ *
1172 residuals[local_eqn] -= scaled_re_st * r * dudt[3] * testf_ *
W;
1175 residuals[local_eqn] -= scaled_re *
1176 (r * interpolated_ur * interpolated_dWSdr +
1177 r * interpolated_duzdr * interpolated_US -
1178 k * interpolated_utheta * interpolated_WC +
1179 r * interpolated_uz * interpolated_dWSdz +
1180 r * interpolated_duzdz * interpolated_WS) *
1186 for (
unsigned j = 0; j < 2; j++)
1188 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[j] *
1189 interpolated_dudx(3, j) * testf_ *
W;
1199 for (
unsigned l2 = 0; l2 < n_node; l2++)
1202 const double psif_ = psif[l2];
1203 const double dpsifdr = dpsifdx(l2, 0);
1204 const double dpsifdz = dpsifdx(l2, 1);
1211 if (local_unknown >= 0)
1214 jacobian(local_eqn, local_unknown) -=
1215 visc_ratio * r *
Gamma[1] * dpsifdz * dtestfdr *
W;
1218 jacobian(local_eqn, local_unknown) -=
1219 scaled_re * r * psif_ * interpolated_duzdr * testf_ *
W;
1224 if (local_unknown >= 0)
1227 jacobian(local_eqn, local_unknown) +=
1228 scaled_re * k * interpolated_utheta * psif_ * testf_ *
W;
1233 if (local_unknown >= 0)
1238 mass_matrix(local_eqn, local_unknown) +=
1239 scaled_re_st * r * psif_ * testf_ *
W;
1245 jacobian(local_eqn, local_unknown) -=
1246 visc_ratio * r * dpsifdr * dtestfdr *
W;
1248 jacobian(local_eqn, local_unknown) -=
1249 visc_ratio * r * (1.0 +
Gamma[1]) * dpsifdz * dtestfdz *
W;
1251 jacobian(local_eqn, local_unknown) -=
1252 visc_ratio * k * k * psif_ * testf_ *
W / r;
1255 jacobian(local_eqn, local_unknown) -=
1261 jacobian(local_eqn, local_unknown) -=
1263 (interpolated_ur * dpsifdr + psif_ * interpolated_duzdz +
1264 interpolated_uz * dpsifdz) *
1271 for (
unsigned j = 0; j < 2; j++)
1273 jacobian(local_eqn, local_unknown) +=
1274 scaled_re_st * r * mesh_velocity[j] * dpsifdx(l2, j) *
1282 if (local_unknown >= 0)
1285 jacobian(local_eqn, local_unknown) -=
1286 visc_ratio *
Gamma[1] * k * dpsifdz * testf_ *
W;
1296 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1302 if (local_unknown >= 0)
1304 jacobian(local_eqn, local_unknown) +=
1305 r * psip[l2] * dtestfdz *
W;
1323 residuals[local_eqn] -= k * interpolated_PS * testf_ *
W;
1326 residuals[local_eqn] +=
1328 (-r * interpolated_dVCdr - k *
Gamma[0] * interpolated_US +
1329 Gamma[0] * interpolated_VC) *
1332 residuals[local_eqn] -=
1334 (k *
Gamma[0] * interpolated_WS + r * interpolated_dVCdz) *
1337 residuals[local_eqn] +=
1339 (
Gamma[0] * interpolated_dVCdr +
1340 k * (2.0 +
Gamma[0]) * interpolated_US / r -
1341 (1.0 + (k * k) + (k * k *
Gamma[0])) * interpolated_VC / r) *
1345 residuals[local_eqn] -= scaled_re_st * r * dudt[4] * testf_ *
W;
1348 residuals[local_eqn] -=
1350 (r * interpolated_ur * interpolated_dVCdr +
1351 r * interpolated_duthetadr * interpolated_UC +
1352 k * interpolated_utheta * interpolated_VS +
1353 interpolated_utheta * interpolated_UC +
1354 interpolated_ur * interpolated_VC +
1355 r * interpolated_uz * interpolated_dVCdz +
1356 r * interpolated_duthetadz * interpolated_WC) *
1362 for (
unsigned j = 0; j < 2; j++)
1364 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[j] *
1365 interpolated_dudx(4, j) * testf_ *
W;
1375 for (
unsigned l2 = 0; l2 < n_node; l2++)
1378 const double psif_ = psif[l2];
1379 const double dpsifdr = dpsifdx(l2, 0);
1380 const double dpsifdz = dpsifdx(l2, 1);
1384 if (local_unknown >= 0)
1387 jacobian(local_eqn, local_unknown) -=
1389 (r * interpolated_duthetadr + interpolated_utheta) * psif_ *
1395 if (local_unknown >= 0)
1398 jacobian(local_eqn, local_unknown) +=
1399 visc_ratio * k * psif_ *
1400 (((2.0 +
Gamma[0]) * testf_ / r) - (
Gamma[0] * dtestfdr)) *
W;
1405 if (local_unknown >= 0)
1408 jacobian(local_eqn, local_unknown) -=
1409 scaled_re * r * psif_ * interpolated_duthetadz * testf_ *
W;
1414 if (local_unknown >= 0)
1417 jacobian(local_eqn, local_unknown) -=
1418 visc_ratio * k *
Gamma[0] * psif_ * dtestfdz *
W;
1423 if (local_unknown >= 0)
1428 mass_matrix(local_eqn, local_unknown) +=
1429 scaled_re_st * r * psif_ * testf_ *
W;
1435 jacobian(local_eqn, local_unknown) +=
1436 visc_ratio * (
Gamma[0] * psif_ - r * dpsifdr) * dtestfdr *
W;
1438 jacobian(local_eqn, local_unknown) -=
1439 visc_ratio * r * dpsifdz * dtestfdz *
W;
1441 jacobian(local_eqn, local_unknown) +=
1443 (
Gamma[0] * dpsifdr -
1444 (1.0 + (k * k) + (k * k *
Gamma[0])) * psif_ / r) *
1448 jacobian(local_eqn, local_unknown) -=
1454 jacobian(local_eqn, local_unknown) -=
1456 (r * interpolated_ur * dpsifdr + interpolated_ur * psif_ +
1457 r * interpolated_uz * dpsifdz) *
1463 for (
unsigned j = 0; j < 2; j++)
1465 jacobian(local_eqn, local_unknown) +=
1466 scaled_re_st * r * mesh_velocity[j] * dpsifdx(l2, j) *
1474 if (local_unknown >= 0)
1477 jacobian(local_eqn, local_unknown) -=
1478 scaled_re * k * interpolated_utheta * psif_ * testf_ *
W;
1484 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1490 if (local_unknown >= 0)
1492 jacobian(local_eqn, local_unknown) -= k * psip[l2] * testf_ *
W;
1510 residuals[local_eqn] += k * interpolated_PC * testf_ *
W;
1513 residuals[local_eqn] +=
1515 (-r * interpolated_dVSdr + k *
Gamma[0] * interpolated_UC +
1516 Gamma[0] * interpolated_VS) *
1519 residuals[local_eqn] +=
1521 (k *
Gamma[0] * interpolated_WC - r * interpolated_dVSdz) *
1524 residuals[local_eqn] +=
1526 (
Gamma[0] * interpolated_dVSdr -
1527 k * (2.0 +
Gamma[0]) * interpolated_UC / r -
1528 (1.0 + (k * k) + (k * k *
Gamma[0])) * interpolated_VS / r) *
1532 residuals[local_eqn] -= scaled_re_st * r * dudt[5] * testf_ *
W;
1535 residuals[local_eqn] -=
1537 (r * interpolated_ur * interpolated_dVSdr +
1538 r * interpolated_duthetadr * interpolated_US -
1539 k * interpolated_utheta * interpolated_VC +
1540 interpolated_utheta * interpolated_US +
1541 interpolated_ur * interpolated_VS +
1542 r * interpolated_uz * interpolated_dVSdz +
1543 r * interpolated_duthetadz * interpolated_WS) *
1549 for (
unsigned j = 0; j < 2; j++)
1551 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[j] *
1552 interpolated_dudx(5, j) * testf_ *
W;
1562 for (
unsigned l2 = 0; l2 < n_node; l2++)
1565 const double psif_ = psif[l2];
1566 const double dpsifdr = dpsifdx(l2, 0);
1567 const double dpsifdz = dpsifdx(l2, 1);
1571 if (local_unknown >= 0)
1574 jacobian(local_eqn, local_unknown) +=
1575 visc_ratio * k * psif_ *
1576 ((
Gamma[0] * dtestfdr) - ((2.0 +
Gamma[0]) * testf_ / r)) *
W;
1581 if (local_unknown >= 0)
1584 jacobian(local_eqn, local_unknown) -=
1586 (r * interpolated_duthetadr + interpolated_utheta) * psif_ *
1592 if (local_unknown >= 0)
1595 jacobian(local_eqn, local_unknown) +=
1596 visc_ratio * k *
Gamma[0] * psif_ * dtestfdz *
W;
1601 if (local_unknown >= 0)
1604 jacobian(local_eqn, local_unknown) -=
1605 scaled_re * r * psif_ * interpolated_duthetadz * testf_ *
W;
1610 if (local_unknown >= 0)
1613 jacobian(local_eqn, local_unknown) +=
1614 scaled_re * k * interpolated_utheta * psif_ * testf_ *
W;
1619 if (local_unknown >= 0)
1624 mass_matrix(local_eqn, local_unknown) +=
1625 scaled_re_st * r * psif_ * testf_ *
W;
1631 jacobian(local_eqn, local_unknown) +=
1632 visc_ratio * (
Gamma[0] * psif_ - r * dpsifdr) * dtestfdr *
W;
1634 jacobian(local_eqn, local_unknown) -=
1635 visc_ratio * r * dpsifdz * dtestfdz *
W;
1637 jacobian(local_eqn, local_unknown) +=
1639 (
Gamma[0] * dpsifdr -
1640 (1.0 + (k * k) + (k * k *
Gamma[0])) * psif_ / r) *
1644 jacobian(local_eqn, local_unknown) -=
1650 jacobian(local_eqn, local_unknown) -=
1652 (r * interpolated_ur * dpsifdr + interpolated_ur * psif_ +
1653 r * interpolated_uz * dpsifdz) *
1659 for (
unsigned j = 0; j < 2; j++)
1661 jacobian(local_eqn, local_unknown) +=
1662 scaled_re_st * r * mesh_velocity[j] * dpsifdx(l2, j) *
1671 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1675 if (local_unknown >= 0)
1677 jacobian(local_eqn, local_unknown) += k * psip[l2] * testf_ *
W;
1695 for (
unsigned l = 0; l < n_pres; l++)
1698 const double testp_ = testp[l];
1711 residuals[local_eqn] +=
1712 (interpolated_UC + r * interpolated_dUCdr + k * interpolated_VS +
1713 r * interpolated_dWCdz) *
1722 for (
unsigned l2 = 0; l2 < n_node; l2++)
1725 const double psif_ = psif[l2];
1726 const double dpsifdr = dpsifdx(l2, 0);
1727 const double dpsifdz = dpsifdx(l2, 1);
1731 if (local_unknown >= 0)
1733 jacobian(local_eqn, local_unknown) +=
1734 (psif_ + r * dpsifdr) * testp_ *
W;
1742 if (local_unknown >= 0)
1744 jacobian(local_eqn, local_unknown) += r * dpsifdz * testp_ *
W;
1755 if (local_unknown >= 0)
1757 jacobian(local_eqn, local_unknown) += k * psif_ * testp_ *
W;
1779 residuals[local_eqn] +=
1780 (interpolated_US + r * interpolated_dUSdr - k * interpolated_VC +
1781 r * interpolated_dWSdz) *
1790 for (
unsigned l2 = 0; l2 < n_node; l2++)
1793 const double psif_ = psif[l2];
1794 const double dpsifdr = dpsifdx(l2, 0);
1795 const double dpsifdz = dpsifdx(l2, 1);
1802 if (local_unknown >= 0)
1804 jacobian(local_eqn, local_unknown) +=
1805 (psif_ + r * dpsifdr) * testp_ *
W;
1813 if (local_unknown >= 0)
1815 jacobian(local_eqn, local_unknown) += r * dpsifdz * testp_ *
W;
1820 if (local_unknown >= 0)
1822 jacobian(local_eqn, local_unknown) -= k * psif_ * testp_ *
W;
1858 6, 6, 6, 6, 6, 6, 6, 6, 6};
1865 const unsigned& n)
const
1884 8, 6, 8, 6, 6, 6, 8, 6, 8};
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned long nrow() const
Return the number of rows of the matrix.
unsigned long ncol() const
Return the number of columns of the matrix.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n. Do not use the hanging node repre...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
const double & viscosity_ratio() const
Viscosity ratio for element: element's viscosity relative to the viscosity used in the definition of ...
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
double du_dt_linearised_axi_nst(const unsigned &n, const unsigned &i) const
Return the i-th component of du/dt at local node n. Uses suitably interpolated value for hanging node...
const double & re() const
Reynolds number.
void output(std::ostream &outfile)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. Default number of pl...
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
virtual void get_base_flow_u(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Calculate the velocity components of the base flow solution at a given time and Eulerian position.
static int Pressure_not_stored_at_node
Static "magic" number that indicates that the pressure is not stored at a node.
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
Access function for the local equation number information for the i-th component of the pressure....
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed....
virtual void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
double interpolated_u_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated velocity u[i] at local coordinate s.
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, in tecplot format. nplot points in each coordina...
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Calculate the derivatives of the velocity components of the base flow solution w.r....
virtual double dshape_and_dtest_eulerian_at_knot_linearised_axi_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and their derivatives w.r.t. global coordinates at the ipt-th integration...
virtual unsigned npres_linearised_axi_nst() const =0
Return the number of pressure degrees of freedom associated with a single pressure component in the e...
double interpolated_p_linearised_axi_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated pressure p[i] at local coordinate s.
const double & density_ratio() const
Density ratio for element: element's density relative to the viscosity used in the definition of the ...
virtual unsigned u_index_linearised_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
const int & azimuthal_mode_number() const
Azimuthal mode number k in e^ik(theta) decomposition.
virtual void fill_in_generic_residual_contribution_linearised_axi_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 Jacobi...
virtual double p_linearised_axi_nst(const unsigned &n_p, const unsigned &i) const =0
Return the i-th pressure value at local pressure "node" n_p. Uses suitably interpolated value for han...
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: where (in that order)
virtual unsigned required_nvalue(const unsigned &n) const
Return number of values (pinned or dofs) required at local node n.
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
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...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
double & time()
Return current value of continous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...