41 int GeneralisedNewtonianAxisymmetricNavierStokesEquations::
42 Pressure_not_stored_at_node = -100;
45 double GeneralisedNewtonianAxisymmetricNavierStokesEquations::
46 Default_Physical_Constant_Value = 0.0;
49 double GeneralisedNewtonianAxisymmetricNavierStokesEquations::
50 Default_Physical_Ratio_Value = 1.0;
58 bool GeneralisedNewtonianAxisymmetricNavierStokesEquations::
59 Pre_multiply_by_viscosity_ratio =
false;
74 const unsigned& which_one)
77 if ((which_one == 0) || (which_one == 1))
79 throw OomphLibError(
"Computation of diagonal of pressure mass matrix is "
80 "not impmented yet.\n",
81 OOMPH_CURRENT_FUNCTION,
82 OOMPH_EXCEPTION_LOCATION);
87 veloc_mass_diag.assign(
ndof(), 0.0);
90 const unsigned n_node =
nnode();
93 const unsigned n_value = 3;
97 for (
unsigned i = 0;
i < n_value;
i++)
112 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
129 for (
unsigned l = 0; l < n_node; l++)
138 for (
unsigned l = 0; l < n_node; l++)
141 for (
unsigned i = 0;
i < n_value;
i++)
149 veloc_mass_diag[local_eqn] += test[l] * test[l] *
W;
164 std::ostream& outfile,
182 outfile <<
"ZONE" << std::endl;
188 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
191 for (
unsigned i = 0;
i < 2;
i++)
206 double W = w * J * x[0];
209 (*exact_soln_pt)(time, x, exact_soln);
212 for (
unsigned i = 0;
i < 3;
i++)
214 norm += exact_soln[
i] * exact_soln[
i] *
W;
220 for (
unsigned i = 0;
i < 2;
i++)
222 outfile << x[
i] <<
" ";
226 for (
unsigned i = 0;
i < 3;
i++)
231 outfile << std::endl;
242 std::ostream& outfile,
259 outfile <<
"ZONE" << std::endl;
265 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
268 for (
unsigned i = 0;
i < 2;
i++)
283 double W = w * J * x[0];
286 (*exact_soln_pt)(x, exact_soln);
289 for (
unsigned i = 0;
i < 3;
i++)
291 norm += exact_soln[
i] * exact_soln[
i] *
W;
297 for (
unsigned i = 0;
i < 2;
i++)
299 outfile << x[
i] <<
" ";
303 for (
unsigned i = 0;
i < 3;
i++)
308 outfile << std::endl;
319 std::ostream& outfile,
320 const unsigned& nplot,
337 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
346 (*exact_soln_pt)(x, exact_soln);
349 for (
unsigned i = 0;
i < 2;
i++)
351 outfile << x[
i] <<
" ";
355 for (
unsigned i = 0;
i < exact_soln.size();
i++)
357 outfile << exact_soln[
i] <<
" ";
360 outfile << std::endl;
374 std::ostream& outfile,
375 const unsigned& nplot,
393 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
402 (*exact_soln_pt)(time, x, exact_soln);
405 for (
unsigned i = 0;
i < 2;
i++)
407 outfile << x[
i] <<
" ";
411 for (
unsigned i = 0;
i < exact_soln.size();
i++)
413 outfile << exact_soln[
i] <<
" ";
416 outfile << std::endl;
431 std::ostream& outfile,
const unsigned& nplot,
const unsigned&
t)
434 unsigned n_node =
nnode();
450 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
459 for (
unsigned i = 0;
i < 2;
i++)
463 for (
unsigned l = 0; l < n_node; l++)
470 for (
unsigned i = 0;
i < 3;
i++)
474 interpolated_u[
i] = 0.0;
476 for (
unsigned l = 0; l < n_node; l++)
478 interpolated_u[
i] +=
nodal_value(
t, l, u_nodal_index) * psi[l];
483 for (
unsigned i = 0;
i < 2;
i++)
489 for (
unsigned i = 0;
i < 3;
i++)
491 outfile << interpolated_u[
i] <<
" ";
494 outfile << std::endl;
508 std::ostream& outfile,
const unsigned& nplot)
518 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
524 for (
unsigned i = 0;
i < 2;
i++)
530 for (
unsigned i = 0;
i < 3;
i++)
538 outfile << std::endl;
540 outfile << std::endl;
554 FILE* file_pt,
const unsigned& nplot)
564 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
570 for (
unsigned i = 0;
i < 2;
i++)
577 for (
unsigned i = 0;
i < 3;
i++)
588 fprintf(file_pt,
"\n");
591 fprintf(file_pt,
"\n");
605 "Check the dissipation calculation for axisymmetric NSt",
606 OOMPH_CURRENT_FUNCTION,
607 OOMPH_EXCEPTION_LOCATION);
619 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
622 for (
unsigned i = 0;
i < 2;
i++)
638 double local_diss = 0.0;
639 for (
unsigned i = 0;
i < 3;
i++)
641 for (
unsigned j = 0; j < 3; j++)
643 local_diss += 2.0 * strainrate(
i, j) * strainrate(
i, j);
647 diss += local_diss * w * J;
673 if ((
N.size() == 3) && (
N[2] != 0.0))
676 "Unit normal passed into this fct should either be 2D (r,z) or have a "
677 "zero component in the theta-direction",
678 OOMPH_CURRENT_FUNCTION,
679 OOMPH_EXCEPTION_LOCATION);
707 for (
unsigned i = 0;
i < 3;
i++)
710 for (
unsigned j = 0; j < 3; j++)
712 traction[
i] += visc * 2.0 * strainrate(
i, j) * n_local[j];
724 "Check the dissipation calculation for axisymmetric NSt",
725 OOMPH_CURRENT_FUNCTION,
726 OOMPH_EXCEPTION_LOCATION);
733 double local_diss = 0.0;
734 for (
unsigned i = 0;
i < 3;
i++)
736 for (
unsigned j = 0; j < 3; j++)
738 local_diss += 2.0 * strainrate(
i, j) * strainrate(
i, j);
753 if ((strainrate.
ncol() != 3) || (strainrate.
nrow() != 3))
755 std::ostringstream error_message;
756 error_message <<
"The strain rate has incorrect dimensions "
757 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
758 <<
" Not 3" << std::endl;
761 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
766 unsigned n_node =
nnode();
776 double interpolated_r = 0.0;
786 double duphidr = 0.0;
787 double duphidz = 0.0;
790 unsigned u_nodal_index[3];
791 for (
unsigned i = 0;
i < 3; ++
i)
798 for (
unsigned l = 0; l < n_node; l++)
806 durdr +=
nodal_value(l, u_nodal_index[0]) * dpsidx(l, 0);
807 durdz +=
nodal_value(l, u_nodal_index[0]) * dpsidx(l, 1);
809 duzdr +=
nodal_value(l, u_nodal_index[1]) * dpsidx(l, 0);
810 duzdz +=
nodal_value(l, u_nodal_index[1]) * dpsidx(l, 1);
812 duphidr +=
nodal_value(l, u_nodal_index[2]) * dpsidx(l, 0);
813 duphidz +=
nodal_value(l, u_nodal_index[2]) * dpsidx(l, 1);
819 strainrate(0, 0) = durdr;
820 strainrate(0, 1) = 0.5 * (durdz + duzdr);
821 strainrate(1, 0) = strainrate(0, 1);
822 strainrate(0, 2) = 0.0;
823 strainrate(2, 0) = strainrate(0, 2);
824 strainrate(1, 1) = duzdz;
825 strainrate(1, 2) = 0.5 * duphidz;
826 strainrate(2, 1) = strainrate(1, 2);
827 strainrate(2, 2) = 0.0;
832 if (std::fabs(interpolated_r) > 1.0e-16)
834 double inverse_radius = 1.0 / interpolated_r;
835 strainrate(0, 2) = 0.5 * (duphidr - inverse_radius * uphi);
836 strainrate(2, 0) = strainrate(0, 2);
837 strainrate(2, 2) = inverse_radius * ur;
842 strainrate(2, 2) = durdr;
856 if ((strainrate.
ncol() != 3) || (strainrate.
nrow() != 3))
858 std::ostringstream error_message;
859 error_message <<
"The strain rate has incorrect dimensions "
860 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
861 <<
" Not 3" << std::endl;
865 "GeneralisedNewtonianAxisymmetricNavierStokeEquations::strain_rate()",
866 OOMPH_EXCEPTION_LOCATION);
871 unsigned n_node =
nnode();
880 for (
unsigned j = 0; j < n_node; j++)
882 backed_up_nodal_position(j, 0) =
node_pt(j)->
x(0);
884 backed_up_nodal_position(j, 1) =
node_pt(j)->
x(1);
892 double interpolated_r = 0.0;
893 double interpolated_z = 0.0;
903 double duphidr = 0.0;
904 double duphidz = 0.0;
907 unsigned u_nodal_index[3];
908 for (
unsigned i = 0;
i < 3; ++
i)
915 for (
unsigned l = 0; l < n_node; l++)
924 durdr +=
nodal_value(
t, l, u_nodal_index[0]) * dpsidx(l, 0);
925 durdz +=
nodal_value(
t, l, u_nodal_index[0]) * dpsidx(l, 1);
927 duzdr +=
nodal_value(
t, l, u_nodal_index[1]) * dpsidx(l, 0);
928 duzdz +=
nodal_value(
t, l, u_nodal_index[1]) * dpsidx(l, 1);
930 duphidr +=
nodal_value(
t, l, u_nodal_index[2]) * dpsidx(l, 0);
931 duphidz +=
nodal_value(
t, l, u_nodal_index[2]) * dpsidx(l, 1);
937 strainrate(0, 0) = durdr;
938 strainrate(0, 1) = 0.5 * (durdz + duzdr);
939 strainrate(1, 0) = strainrate(0, 1);
940 strainrate(0, 2) = 0.0;
941 strainrate(2, 0) = strainrate(0, 2);
942 strainrate(1, 1) = duzdz;
943 strainrate(1, 2) = 0.5 * duphidz;
944 strainrate(2, 1) = strainrate(1, 2);
945 strainrate(2, 2) = 0.0;
950 if (std::fabs(interpolated_r) > 1.0e-16)
952 double inverse_radius = 1.0 / interpolated_r;
953 strainrate(0, 2) = 0.5 * (duphidr - inverse_radius * uphi);
954 strainrate(2, 0) = strainrate(0, 2);
955 strainrate(2, 2) = inverse_radius * ur;
960 strainrate(2, 2) = durdr;
964 for (
unsigned j = 0; j < n_node; j++)
966 node_pt(j)->
x(0) = backed_up_nodal_position(j, 0);
967 node_pt(j)->
x(1) = backed_up_nodal_position(j, 1);
981 if ((strainrate.
ncol() != 3) || (strainrate.
nrow() != 3))
983 std::ostringstream error_message;
984 error_message <<
"The strain rate has incorrect dimensions "
985 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
986 <<
" Not 3" << std::endl;
989 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1008 for (
unsigned i = 0;
i < 3;
i++)
1010 for (
unsigned j = 0; j < 3; j++)
1014 (strain_rate_minus_one(
i, j) - strain_rate_minus_two(
i, j)) / dt_prev;
1017 strainrate(
i, j) = strain_rate_minus_one(
i, j) + slope * dt_current;
1029 "Check the kinetic energy calculation for axisymmetric NSt",
1030 OOMPH_CURRENT_FUNCTION,
1031 OOMPH_EXCEPTION_LOCATION);
1034 double kin_en = 0.0;
1043 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
1046 for (
unsigned i = 0;
i < 2;
i++)
1058 double veloc_squared = 0.0;
1059 for (
unsigned i = 0;
i < 3;
i++)
1078 double press_int = 0;
1087 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
1090 for (
unsigned i = 0;
i < 2;
i++)
1108 press_int += press *
W;
1120 double& max_invariant,
1121 double& min_viscosity,
1122 double& max_viscosity)
const
1125 min_invariant = DBL_MAX;
1126 max_invariant = -DBL_MAX;
1127 min_viscosity = DBL_MAX;
1128 max_viscosity = -DBL_MAX;
1137 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
1155 min_viscosity = std::min(min_viscosity, viscosity);
1156 max_viscosity = std::max(max_viscosity, viscosity);
1174 if (
ndof() == 0)
return;
1177 unsigned n_node =
nnode();
1186 unsigned u_nodal_index[3];
1187 for (
unsigned i = 0;
i < 3; ++
i)
1194 Shape psif(n_node), testf(n_node);
1195 DShape dpsifdx(n_node, 2), dtestfdx(n_node, 2);
1198 Shape psip(n_pres), testp(n_pres);
1216 int local_eqn = 0, local_unknown = 0;
1219 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
1228 ipt, psif, dpsifdx, testf, dtestfdx);
1242 double interpolated_p = 0.0;
1248 for (
unsigned l = 0; l < n_pres; l++)
1250 interpolated_p +=
p_axi_nst(l) * psip[l];
1256 for (
unsigned l = 0; l < n_node; l++)
1259 const double psif_ = psif(l);
1261 for (
unsigned i = 0;
i < 2;
i++)
1267 for (
unsigned i = 0;
i < 3;
i++)
1271 interpolated_u[
i] += u_value * psif_;
1274 for (
unsigned j = 0; j < 2; j++)
1276 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
1285 for (
unsigned l = 0; l < n_node; l++)
1288 for (
unsigned i = 0;
i < 2;
i++)
1303 strain_rate(
s, strainrate_to_compute_second_invariant);
1312 strainrate_to_compute_second_invariant);
1340 double dviscosity_dsecond_invariant =
1355 dinvariant_dstrainrate(0, 0) =
1356 strainrate_ref(1, 1) + strainrate_ref(2, 2);
1358 dinvariant_dstrainrate(1, 1) =
1359 strainrate_ref(0, 0) + strainrate_ref(2, 2);
1361 dinvariant_dstrainrate(2, 2) =
1362 strainrate_ref(0, 0) + strainrate_ref(1, 1);
1364 dinvariant_dstrainrate(0, 1) = -strainrate_ref(1, 0);
1366 dinvariant_dstrainrate(1, 0) = -strainrate_ref(0, 1);
1368 dinvariant_dstrainrate(0, 2) = -strainrate_ref(2, 0);
1370 dinvariant_dstrainrate(2, 0) = -strainrate_ref(0, 2);
1372 dinvariant_dstrainrate(2, 1) = -strainrate_ref(1, 2);
1374 dinvariant_dstrainrate(1, 2) = -strainrate_ref(2, 1);
1377 for (
unsigned l = 0; l < n_node; l++)
1383 for (
unsigned i = 0;
i < 3;
i++)
1398 double dinvariant_dunknown = 0.0;
1401 for (
unsigned m = 0; m < 3; m++)
1403 for (
unsigned n = 0; n < 3; n++)
1407 double dstrainrate_dunknown = 0.0;
1422 dstrainrate_dunknown = dpsifdx(l, 0);
1430 dstrainrate_dunknown = 0.5 * dpsifdx(l, 1);
1434 dstrainrate_dunknown = 0.5 * dpsifdx(l, 0);
1442 dstrainrate_dunknown =
1443 0.5 * dpsifdx(l, 0) - 0.5 / r * psif[l];
1448 std::ostringstream error_stream;
1449 error_stream <<
"Should never get here...";
1451 OOMPH_CURRENT_FUNCTION,
1452 OOMPH_EXCEPTION_LOCATION);
1467 dstrainrate_dunknown = 0.5 * dpsifdx(l, 1);
1471 dstrainrate_dunknown = 0.5 * dpsifdx(l, 0);
1479 dstrainrate_dunknown = dpsifdx(l, 1);
1491 dstrainrate_dunknown = 0.5 * dpsifdx(l, 1);
1496 std::ostringstream error_stream;
1497 error_stream <<
"Should never get here...";
1499 OOMPH_CURRENT_FUNCTION,
1500 OOMPH_EXCEPTION_LOCATION);
1515 dstrainrate_dunknown =
1516 0.5 * dpsifdx(l, 0) - 0.5 / r * psif[l];
1524 dstrainrate_dunknown = 0.5 * dpsifdx(l, 1);
1532 dstrainrate_dunknown = 1.0 / r * psif[l];
1537 std::ostringstream error_stream;
1538 error_stream <<
"Should never get here...";
1540 OOMPH_CURRENT_FUNCTION,
1541 OOMPH_EXCEPTION_LOCATION);
1547 std::ostringstream error_stream;
1548 error_stream <<
"Should never get here...";
1550 OOMPH_CURRENT_FUNCTION,
1551 OOMPH_EXCEPTION_LOCATION);
1557 dinvariant_dunknown +=
1558 dinvariant_dstrainrate(m, n) * dstrainrate_dunknown;
1574 dviscosity_dsecond_invariant * dinvariant_dunknown;
1579 dviscosity_dsecond_invariant * dinvariant_dunknown;
1583 dviscosity_dUphi[l] =
1584 dviscosity_dsecond_invariant * dinvariant_dunknown;
1588 std::ostringstream error_stream;
1589 error_stream <<
"Should never get here...";
1591 OOMPH_CURRENT_FUNCTION,
1592 OOMPH_EXCEPTION_LOCATION);
1605 for (
unsigned l = 0; l < n_node; l++)
1613 residuals[local_eqn] += r * body_force[0] * testf[l] *
W;
1616 residuals[local_eqn] += r * scaled_re_inv_fr * testf[l] * G[0] *
W;
1622 residuals[local_eqn] += visc_ratio * viscosity * interpolated_p *
1623 (testf[l] + r * dtestfdx(l, 0)) *
W;
1627 residuals[local_eqn] +=
1628 interpolated_p * (testf[l] + r * dtestfdx(l, 0)) *
W;
1636 residuals[local_eqn] -= visc_ratio * viscosity * r *
1637 (1.0 +
Gamma[0]) * interpolated_dudx(0, 0) *
1641 residuals[local_eqn] -=
1642 visc_ratio * viscosity * r *
1643 (interpolated_dudx(0, 1) +
Gamma[0] * interpolated_dudx(1, 0)) *
1647 residuals[local_eqn] -= visc_ratio * viscosity * (1.0 +
Gamma[0]) *
1648 interpolated_u[0] * testf[l] *
W / r;
1652 residuals[local_eqn] -= scaled_re_st * r * dudt[0] * testf[l] *
W;
1655 residuals[local_eqn] -=
1657 (r * interpolated_u[0] * interpolated_dudx(0, 0) -
1658 interpolated_u[2] * interpolated_u[2] +
1659 r * interpolated_u[1] * interpolated_dudx(0, 1)) *
1665 for (
unsigned k = 0; k < 2; k++)
1667 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[k] *
1668 interpolated_dudx(0, k) * testf[l] *
W;
1673 residuals[local_eqn] +=
1674 2.0 * r * scaled_re_inv_ro * interpolated_u[2] * testf[l] *
W;
1680 for (
unsigned l2 = 0; l2 < n_node; l2++)
1684 if (local_unknown >= 0)
1689 mass_matrix(local_eqn, local_unknown) +=
1690 scaled_re_st * r * psif[l2] * testf[l] *
W;
1694 jacobian(local_eqn, local_unknown) -=
1695 visc_ratio * viscosity * r * (1.0 +
Gamma[0]) *
1696 dpsifdx(l2, 0) * dtestfdx(l, 0) *
W;
1701 jacobian(local_eqn, local_unknown) -=
1702 visc_ratio * dviscosity_dUr[l2] * r * (1.0 +
Gamma[0]) *
1703 interpolated_dudx(0, 0) * dtestfdx(l, 0) *
W;
1707 jacobian(local_eqn, local_unknown) -= visc_ratio * viscosity *
1708 r * dpsifdx(l2, 1) *
1714 jacobian(local_eqn, local_unknown) -=
1715 visc_ratio * dviscosity_dUr[l2] * r *
1716 (interpolated_dudx(0, 1) +
1717 Gamma[0] * interpolated_dudx(1, 0)) *
1722 jacobian(local_eqn, local_unknown) -=
1723 visc_ratio * viscosity * (1.0 +
Gamma[0]) * psif[l2] *
1729 jacobian(local_eqn, local_unknown) -=
1730 visc_ratio * dviscosity_dUr[l2] * (1.0 +
Gamma[0]) *
1731 interpolated_u[0] * testf[l] *
W / r;
1736 jacobian(local_eqn, local_unknown) -=
1742 jacobian(local_eqn, local_unknown) -=
1744 (r * psif[l2] * interpolated_dudx(0, 0) +
1745 r * interpolated_u[0] * dpsifdx(l2, 0) +
1746 r * interpolated_u[1] * dpsifdx(l2, 1)) *
1752 for (
unsigned k = 0; k < 2; k++)
1754 jacobian(local_eqn, local_unknown) +=
1755 scaled_re_st * r * mesh_velocity[k] * dpsifdx(l2, k) *
1764 if (local_unknown >= 0)
1771 jacobian(local_eqn, local_unknown) -=
1772 visc_ratio * dviscosity_dUz[l2] * r * (1.0 +
Gamma[0]) *
1773 interpolated_dudx(0, 0) * dtestfdx(l, 0) *
W;
1777 jacobian(local_eqn, local_unknown) -=
1778 visc_ratio * viscosity * r *
Gamma[0] * dpsifdx(l2, 0) *
1784 jacobian(local_eqn, local_unknown) -=
1785 visc_ratio * dviscosity_dUz[l2] * r *
1786 (interpolated_dudx(0, 1) +
1787 Gamma[0] * interpolated_dudx(1, 0)) *
1796 jacobian(local_eqn, local_unknown) -=
1797 visc_ratio * dviscosity_dUz[l2] * (1.0 +
Gamma[0]) *
1798 interpolated_u[0] * testf[l] *
W / r;
1802 jacobian(local_eqn, local_unknown) -= scaled_re * r * psif[l2] *
1803 interpolated_dudx(0, 1) *
1809 if (local_unknown >= 0)
1816 jacobian(local_eqn, local_unknown) -=
1817 visc_ratio * dviscosity_dUphi[l2] * r * (1.0 +
Gamma[0]) *
1818 interpolated_dudx(0, 0) * dtestfdx(l, 0) *
W;
1826 jacobian(local_eqn, local_unknown) -=
1827 visc_ratio * dviscosity_dUphi[l2] * r *
1828 (interpolated_dudx(0, 1) +
1829 Gamma[0] * interpolated_dudx(1, 0)) *
1838 jacobian(local_eqn, local_unknown) -=
1839 visc_ratio * dviscosity_dUphi[l2] * (1.0 +
Gamma[0]) *
1840 interpolated_u[0] * testf[l] *
W / r;
1844 jacobian(local_eqn, local_unknown) -= -scaled_re * 2.0 *
1846 psif[l2] * testf[l] *
W;
1849 jacobian(local_eqn, local_unknown) +=
1850 2.0 * r * scaled_re_inv_ro * psif[l2] * testf[l] *
W;
1857 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1861 if (local_unknown >= 0)
1865 jacobian(local_eqn, local_unknown) +=
1866 visc_ratio * viscosity * psip[l2] *
1867 (testf[l] + r * dtestfdx(l, 0)) *
W;
1871 jacobian(local_eqn, local_unknown) +=
1872 psip[l2] * (testf[l] + r * dtestfdx(l, 0)) *
W;
1887 residuals[local_eqn] += r * body_force[1] * testf[l] *
W;
1890 residuals[local_eqn] += r * scaled_re_inv_fr * testf[l] * G[1] *
W;
1896 residuals[local_eqn] +=
1897 r * visc_ratio * viscosity * interpolated_p * dtestfdx(l, 1) *
W;
1901 residuals[local_eqn] += r * interpolated_p * dtestfdx(l, 1) *
W;
1909 residuals[local_eqn] -=
1910 visc_ratio * viscosity * r *
1911 (interpolated_dudx(1, 0) +
Gamma[1] * interpolated_dudx(0, 1)) *
1915 residuals[local_eqn] -= visc_ratio * viscosity * r *
1916 (1.0 +
Gamma[1]) * interpolated_dudx(1, 1) *
1921 residuals[local_eqn] -= scaled_re_st * r * dudt[1] * testf[l] *
W;
1924 residuals[local_eqn] -=
1926 (r * interpolated_u[0] * interpolated_dudx(1, 0) +
1927 r * interpolated_u[1] * interpolated_dudx(1, 1)) *
1933 for (
unsigned k = 0; k < 2; k++)
1935 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[k] *
1936 interpolated_dudx(1, k) * testf[l] *
W;
1944 for (
unsigned l2 = 0; l2 < n_node; l2++)
1948 if (local_unknown >= 0)
1955 jacobian(local_eqn, local_unknown) -=
1956 visc_ratio * viscosity * r *
Gamma[1] * dpsifdx(l2, 1) *
1962 jacobian(local_eqn, local_unknown) -=
1963 visc_ratio * dviscosity_dUr[l2] * r *
1964 (interpolated_dudx(1, 0) +
1965 Gamma[1] * interpolated_dudx(0, 1)) *
1974 jacobian(local_eqn, local_unknown) -=
1975 visc_ratio * dviscosity_dUr[l2] * r * (1.0 +
Gamma[1]) *
1976 interpolated_dudx(1, 1) * dtestfdx(l, 1) *
W;
1980 jacobian(local_eqn, local_unknown) -= scaled_re * r * psif[l2] *
1981 interpolated_dudx(1, 0) *
1987 if (local_unknown >= 0)
1992 mass_matrix(local_eqn, local_unknown) +=
1993 scaled_re_st * r * psif[l2] * testf[l] *
W;
2001 jacobian(local_eqn, local_unknown) -= visc_ratio * viscosity *
2002 r * dpsifdx(l2, 0) *
2008 jacobian(local_eqn, local_unknown) -=
2009 visc_ratio * dviscosity_dUz[l2] * r *
2010 (interpolated_dudx(1, 0) +
2011 Gamma[1] * interpolated_dudx(0, 1)) *
2016 jacobian(local_eqn, local_unknown) -=
2017 visc_ratio * viscosity * r * (1.0 +
Gamma[1]) *
2018 dpsifdx(l2, 1) * dtestfdx(l, 1) *
W;
2023 jacobian(local_eqn, local_unknown) -=
2024 visc_ratio * dviscosity_dUz[l2] * r * (1.0 +
Gamma[1]) *
2025 interpolated_dudx(1, 1) * dtestfdx(l, 1) *
W;
2030 jacobian(local_eqn, local_unknown) -=
2036 jacobian(local_eqn, local_unknown) -=
2038 (r * interpolated_u[0] * dpsifdx(l2, 0) +
2039 r * psif[l2] * interpolated_dudx(1, 1) +
2040 r * interpolated_u[1] * dpsifdx(l2, 1)) *
2047 for (
unsigned k = 0; k < 2; k++)
2049 jacobian(local_eqn, local_unknown) +=
2050 scaled_re_st * r * mesh_velocity[k] * dpsifdx(l2, k) *
2060 if (local_unknown >= 0)
2065 jacobian(local_eqn, local_unknown) -=
2066 visc_ratio * dviscosity_dUphi[l2] * r *
2067 (interpolated_dudx(1, 0) +
2068 Gamma[1] * interpolated_dudx(0, 1)) *
2072 jacobian(local_eqn, local_unknown) -=
2073 visc_ratio * dviscosity_dUphi[l2] * r * (1.0 +
Gamma[1]) *
2074 interpolated_dudx(1, 1) * dtestfdx(l, 1) *
W;
2082 for (
unsigned l2 = 0; l2 < n_pres; l2++)
2086 if (local_unknown >= 0)
2090 jacobian(local_eqn, local_unknown) +=
2091 r * visc_ratio * viscosity * psip[l2] * dtestfdx(l, 1) *
W;
2095 jacobian(local_eqn, local_unknown) +=
2096 r * psip[l2] * dtestfdx(l, 1) *
W;
2110 residuals[local_eqn] += r * body_force[2] * testf[l] *
W;
2113 residuals[local_eqn] += r * scaled_re_inv_fr * testf[l] * G[2] *
W;
2122 residuals[local_eqn] -=
2123 visc_ratio * viscosity *
2124 (r * interpolated_dudx(2, 0) -
Gamma[0] * interpolated_u[2]) *
2128 residuals[local_eqn] -= visc_ratio * viscosity * r *
2129 interpolated_dudx(2, 1) * dtestfdx(l, 1) *
W;
2132 residuals[local_eqn] -=
2133 visc_ratio * viscosity *
2134 ((interpolated_u[2] / r) -
Gamma[0] * interpolated_dudx(2, 0)) *
2140 residuals[local_eqn] -= scaled_re_st * r * dudt[2] * testf[l] *
W;
2143 residuals[local_eqn] -=
2145 (r * interpolated_u[0] * interpolated_dudx(2, 0) +
2146 interpolated_u[0] * interpolated_u[2] +
2147 r * interpolated_u[1] * interpolated_dudx(2, 1)) *
2153 for (
unsigned k = 0; k < 2; k++)
2155 residuals[local_eqn] += scaled_re_st * r * mesh_velocity[k] *
2156 interpolated_dudx(2, k) * testf[l] *
W;
2161 residuals[local_eqn] -=
2162 2.0 * r * scaled_re_inv_ro * interpolated_u[0] * testf[l] *
W;
2168 for (
unsigned l2 = 0; l2 < n_node; l2++)
2172 if (local_unknown >= 0)
2177 jacobian(local_eqn, local_unknown) -=
2178 visc_ratio * dviscosity_dUr[l2] *
2179 (r * interpolated_dudx(2, 0) -
2180 Gamma[0] * interpolated_u[2]) *
2184 jacobian(local_eqn, local_unknown) -=
2185 visc_ratio * dviscosity_dUr[l2] * r *
2186 interpolated_dudx(2, 1) * dtestfdx(l, 1) *
W;
2189 jacobian(local_eqn, local_unknown) -=
2190 visc_ratio * dviscosity_dUr[l2] *
2191 ((interpolated_u[2] / r) -
2192 Gamma[0] * interpolated_dudx(2, 0)) *
2197 jacobian(local_eqn, local_unknown) -=
2199 (r * psif[l2] * interpolated_dudx(2, 0) +
2200 psif[l2] * interpolated_u[2]) *
2204 jacobian(local_eqn, local_unknown) -=
2205 2.0 * r * scaled_re_inv_ro * psif[l2] * testf[l] *
W;
2210 if (local_unknown >= 0)
2215 jacobian(local_eqn, local_unknown) -=
2216 visc_ratio * dviscosity_dUz[l2] *
2217 (r * interpolated_dudx(2, 0) -
2218 Gamma[0] * interpolated_u[2]) *
2222 jacobian(local_eqn, local_unknown) -=
2223 visc_ratio * dviscosity_dUz[l2] * r *
2224 interpolated_dudx(2, 1) * dtestfdx(l, 1) *
W;
2227 jacobian(local_eqn, local_unknown) -=
2228 visc_ratio * dviscosity_dUz[l2] *
2229 ((interpolated_u[2] / r) -
2230 Gamma[0] * interpolated_dudx(2, 0)) *
2235 jacobian(local_eqn, local_unknown) -= scaled_re * r * psif[l2] *
2236 interpolated_dudx(2, 1) *
2242 if (local_unknown >= 0)
2247 mass_matrix(local_eqn, local_unknown) +=
2248 scaled_re_st * r * psif[l2] * testf[l] *
W;
2256 jacobian(local_eqn, local_unknown) -=
2257 visc_ratio * viscosity *
2258 (r * dpsifdx(l2, 0) -
Gamma[0] * psif[l2]) * dtestfdx(l, 0) *
2264 jacobian(local_eqn, local_unknown) -=
2265 visc_ratio * dviscosity_dUphi[l2] *
2266 (r * interpolated_dudx(2, 0) -
2267 Gamma[0] * interpolated_u[2]) *
2272 jacobian(local_eqn, local_unknown) -= visc_ratio * viscosity *
2273 r * dpsifdx(l2, 1) *
2279 jacobian(local_eqn, local_unknown) -=
2280 visc_ratio * dviscosity_dUphi[l2] * r *
2281 interpolated_dudx(2, 1) * dtestfdx(l, 1) *
W;
2285 jacobian(local_eqn, local_unknown) -=
2286 visc_ratio * viscosity *
2287 ((psif[l2] / r) -
Gamma[0] * dpsifdx(l2, 0)) * testf[l] *
W;
2292 jacobian(local_eqn, local_unknown) -=
2293 visc_ratio * dviscosity_dUphi[l2] *
2294 ((interpolated_u[2] / r) -
2295 Gamma[0] * interpolated_dudx(2, 0)) *
2301 jacobian(local_eqn, local_unknown) -=
2307 jacobian(local_eqn, local_unknown) -=
2309 (r * interpolated_u[0] * dpsifdx(l2, 0) +
2310 interpolated_u[0] * psif[l2] +
2311 r * interpolated_u[1] * dpsifdx(l2, 1)) *
2317 for (
unsigned k = 0; k < 2; k++)
2319 jacobian(local_eqn, local_unknown) +=
2320 scaled_re_st * r * mesh_velocity[k] * dpsifdx(l2, k) *
2339 for (
unsigned l = 0; l < n_pres; l++)
2346 residuals[local_eqn] -= r * source * testp[l] *
W;
2352 residuals[local_eqn] +=
2353 visc_ratio * viscosity *
2354 (interpolated_u[0] + r * interpolated_dudx(0, 0) +
2355 r * interpolated_dudx(1, 1)) *
2360 residuals[local_eqn] +=
2361 (interpolated_u[0] + r * interpolated_dudx(0, 0) +
2362 r * interpolated_dudx(1, 1)) *
2370 for (
unsigned l2 = 0; l2 < n_node; l2++)
2374 if (local_unknown >= 0)
2378 jacobian(local_eqn, local_unknown) +=
2379 visc_ratio * viscosity * (psif[l2] + r * dpsifdx(l2, 0)) *
2384 jacobian(local_eqn, local_unknown) +=
2385 (psif[l2] + r * dpsifdx(l2, 0)) * testp[l] *
W;
2391 if (local_unknown >= 0)
2395 jacobian(local_eqn, local_unknown) +=
2396 r * visc_ratio * viscosity * dpsifdx(l2, 1) * testp[l] *
W;
2400 jacobian(local_eqn, local_unknown) +=
2401 r * dpsifdx(l2, 1) * testp[l] *
W;
2425 "This has not been checked for generalised Newtonian elements!",
2426 OOMPH_CURRENT_FUNCTION,
2427 OOMPH_EXCEPTION_LOCATION);
2436 const unsigned n_node =
nnode();
2445 unsigned u_nodal_index[3];
2446 for (
unsigned i = 0;
i < 3;
i++)
2453 Shape psif(n_node), testf(n_node);
2454 DShape dpsifdx(n_node, 2), dtestfdx(n_node, 2);
2457 Shape psip(n_pres), testp(n_pres);
2503 bool element_has_node_with_aux_node_update_fct =
false;
2504 for (
unsigned q = 0; q < n_node; q++)
2512 element_has_node_with_aux_node_update_fct =
true;
2516 std::ostringstream warning_stream;
2517 warning_stream <<
"\nThe functionality to evaluate the additional"
2518 <<
"\ncontribution to the deriv of the residual eqn"
2519 <<
"\nw.r.t. the nodal coordinates which comes about"
2520 <<
"\nif a node's values are updated using an auxiliary"
2521 <<
"\nnode update function has NOT been tested for"
2522 <<
"\naxisymmetric Navier-Stokes elements. Use at your"
2523 <<
"\nown risk" << std::endl;
2525 "GeneralisedNewtonianAxisymmetricNavierStokesEquations:"
2526 ":get_dresidual_dnodal_coordinates",
2527 OOMPH_EXCEPTION_LOCATION);
2531 for (
unsigned i = 0;
i < 3;
i++)
2533 u_ref[
i] = *(nod_pt->
value_pt(u_nodal_index[
i]));
2537 for (
unsigned p = 0; p < 2; p++)
2540 double backup = nod_pt->
x(p);
2544 nod_pt->
x(p) += eps_fd;
2550 for (
unsigned i = 0;
i < 3;
i++)
2554 (*(nod_pt->
value_pt(u_nodal_index[
i])) - u_ref[
i]) / eps_fd;
2558 nod_pt->
x(p) = backup;
2570 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
2573 for (
unsigned i = 0;
i < 2;
i++)
2601 double interpolated_p = 0.0;
2607 for (
unsigned l = 0; l < n_pres; l++)
2609 interpolated_p +=
p_axi_nst(l) * psip[l];
2616 for (
unsigned l = 0; l < n_node; l++)
2619 const double psif_ = psif(l);
2622 for (
unsigned i = 0;
i < 2;
i++)
2628 for (
unsigned i = 0;
i < 3;
i++)
2632 interpolated_u[
i] += u_value * psif_;
2636 for (
unsigned j = 0; j < 2; j++)
2638 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
2647 for (
unsigned l = 0; l < n_node; l++)
2650 for (
unsigned i = 0;
i < 2;
i++)
2658 for (
unsigned q = 0; q < n_node; q++)
2661 for (
unsigned p = 0; p < 2; p++)
2664 for (
unsigned i = 0;
i < 3;
i++)
2667 for (
unsigned k = 0; k < 2; k++)
2672 for (
unsigned j = 0; j < n_node; j++)
2675 d_dpsifdx_dX(p, q, j, k);
2677 d_dudx_dX(p, q,
i, k) = aux;
2685 const double pos_time_weight =
2687 const double val_time_weight =
2720 for (
unsigned l = 0; l < n_node; l++)
2723 const double testf_ = testf[l];
2735 for (
unsigned p = 0; p < 2; p++)
2738 for (
unsigned q = 0; q < n_node; q++)
2744 double sum = r * body_force[0] * testf_;
2747 sum += r * scaled_re_inv_fr * testf_ * G[0];
2750 sum += interpolated_p * (testf_ + r * dtestfdx(l, 0));
2756 sum -= visc_ratio * r * (1.0 +
Gamma[0]) *
2757 interpolated_dudx(0, 0) * dtestfdx(l, 0);
2761 (interpolated_dudx(0, 1) +
Gamma[0] * interpolated_dudx(1, 0)) *
2765 visc_ratio * (1.0 +
Gamma[0]) * interpolated_u[0] * testf_ / r;
2768 sum -= scaled_re_st * r * dudt[0] * testf_;
2772 (r * interpolated_u[0] * interpolated_dudx(0, 0) -
2773 interpolated_u[2] * interpolated_u[2] +
2774 r * interpolated_u[1] * interpolated_dudx(0, 1)) *
2780 for (
unsigned k = 0; k < 2; k++)
2782 sum += scaled_re_st * r * mesh_velocity[k] *
2783 interpolated_dudx(0, k) * testf_;
2788 sum += 2.0 * r * scaled_re_inv_ro * interpolated_u[2] * testf_;
2791 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2792 sum * dJ_dX(p, q) * w;
2798 sum = r * d_body_force_dx(0, p) * psif[q] * testf_;
2801 sum += body_force[0] * psif[q] * testf_;
2807 sum += scaled_re_inv_fr * G[0] * psif[q] * testf_;
2811 sum += r * interpolated_p * d_dtestfdx_dX(p, q, l, 0);
2814 sum += interpolated_p * psif[q] * dtestfdx(l, 0);
2821 (d_dudx_dX(p, q, 0, 0) * dtestfdx(l, 0) +
2822 interpolated_dudx(0, 0) * d_dtestfdx_dX(p, q, l, 0)) +
2823 (d_dudx_dX(p, q, 0, 1) +
Gamma[0] * d_dudx_dX(p, q, 1, 0)) *
2825 (interpolated_dudx(0, 1) +
2826 Gamma[0] * interpolated_dudx(1, 0)) *
2827 d_dtestfdx_dX(p, q, l, 1));
2832 (interpolated_dudx(0, 0) * psif[q] * dtestfdx(l, 0) -
2833 interpolated_u[0] * psif[q] * testf_ / (r * r)) +
2834 (interpolated_dudx(0, 1) +
2835 Gamma[0] * interpolated_dudx(1, 0)) *
2836 psif[q] * dtestfdx(l, 1));
2840 for (
unsigned k = 0; k < 2; k++)
2842 double tmp = scaled_re * interpolated_u[k];
2845 tmp -= scaled_re_st * mesh_velocity[k];
2847 sum -= r * tmp * d_dudx_dX(p, q, 0, k) * testf_;
2850 sum -= tmp * interpolated_dudx(0, k) * psif[q] * testf_;
2855 sum += scaled_re_st * r * pos_time_weight *
2856 interpolated_dudx(0, p) * psif[q] * testf_;
2862 sum -= scaled_re_st * dudt[0] * psif[q] * testf_;
2869 2.0 * scaled_re_inv_ro * interpolated_u[2] * psif[q] * testf_;
2873 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
2877 if (element_has_node_with_aux_node_update_fct)
2881 scaled_re_st * r * val_time_weight * psif[q] * testf_;
2883 r * scaled_re * interpolated_dudx(0, 0) * psif[q] * testf_;
2884 for (
unsigned k = 0; k < 2; k++)
2886 double tmp2 = scaled_re * interpolated_u[k];
2889 tmp2 -= scaled_re_st * mesh_velocity[k];
2891 tmp += r * tmp2 * dpsifdx(q, k) * testf_;
2894 tmp += r * visc_ratio * (1.0 +
Gamma[0]) * dpsifdx(q, 0) *
2896 tmp += r * visc_ratio * dpsifdx(q, 1) * dtestfdx(l, 1);
2897 tmp += visc_ratio * (1.0 +
Gamma[0]) * psif[q] * testf_ / r;
2900 sum = -d_U_dX(p, q, 0) * tmp;
2904 scaled_re * r * interpolated_dudx(0, 1) * psif[q] * testf_;
2906 r * visc_ratio *
Gamma[0] * dpsifdx(q, 0) * dtestfdx(l, 1);
2909 sum -= d_U_dX(p, q, 1) * tmp;
2913 (r * scaled_re_inv_ro + scaled_re * interpolated_u[2]) *
2917 sum += d_U_dX(p, q, 2) * tmp;
2920 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
2936 for (
unsigned p = 0; p < 2; p++)
2939 for (
unsigned q = 0; q < n_node; q++)
2945 double sum = r * body_force[1] * testf_;
2948 sum += r * scaled_re_inv_fr * testf_ * G[1];
2951 sum += r * interpolated_p * dtestfdx(l, 1);
2959 (interpolated_dudx(1, 0) +
Gamma[1] * interpolated_dudx(0, 1)) *
2962 sum -= visc_ratio * r * (1.0 +
Gamma[1]) *
2963 interpolated_dudx(1, 1) * dtestfdx(l, 1);
2966 sum -= scaled_re_st * r * dudt[1] * testf_;
2970 (r * interpolated_u[0] * interpolated_dudx(1, 0) +
2971 r * interpolated_u[1] * interpolated_dudx(1, 1)) *
2977 for (
unsigned k = 0; k < 2; k++)
2979 sum += scaled_re_st * r * mesh_velocity[k] *
2980 interpolated_dudx(1, k) * testf_;
2985 dresidual_dnodal_coordinates(local_eqn, p, q) +=
2986 sum * dJ_dX(p, q) * w;
2992 sum = r * d_body_force_dx(1, p) * psif[q] * testf_;
2995 sum += body_force[1] * psif[q] * testf_;
3001 sum += scaled_re_inv_fr * G[1] * psif[q] * testf_;
3005 sum += r * interpolated_p * d_dtestfdx_dX(p, q, l, 1);
3008 sum += interpolated_p * psif[q] * dtestfdx(l, 1);
3014 ((d_dudx_dX(p, q, 1, 0) +
Gamma[1] * d_dudx_dX(p, q, 0, 1)) *
3016 (interpolated_dudx(1, 0) +
3017 Gamma[1] * interpolated_dudx(0, 1)) *
3018 d_dtestfdx_dX(p, q, l, 0) +
3019 (1.0 +
Gamma[1]) * d_dudx_dX(p, q, 1, 1) * dtestfdx(l, 1) +
3020 (1.0 +
Gamma[1]) * interpolated_dudx(1, 1) *
3021 d_dtestfdx_dX(p, q, l, 1));
3025 visc_ratio * ((interpolated_dudx(1, 0) +
3026 Gamma[1] * interpolated_dudx(0, 1)) *
3027 psif[q] * dtestfdx(l, 0) +
3028 (1.0 +
Gamma[1]) * interpolated_dudx(1, 1) *
3029 psif[q] * dtestfdx(l, 1));
3033 for (
unsigned k = 0; k < 2; k++)
3035 double tmp = scaled_re * interpolated_u[k];
3038 tmp -= scaled_re_st * mesh_velocity[k];
3040 sum -= r * tmp * d_dudx_dX(p, q, 1, k) * testf_;
3043 sum -= tmp * interpolated_dudx(1, k) * psif[q] * testf_;
3048 sum += scaled_re_st * r * pos_time_weight *
3049 interpolated_dudx(1, p) * psif[q] * testf_;
3055 sum -= scaled_re_st * dudt[1] * psif[q] * testf_;
3059 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
3063 if (element_has_node_with_aux_node_update_fct)
3067 scaled_re * r * interpolated_dudx(1, 0) * psif[q] * testf_;
3069 r * visc_ratio *
Gamma[1] * dpsifdx(q, 1) * dtestfdx(l, 0);
3072 sum = -d_U_dX(p, q, 0) * tmp;
3075 tmp = scaled_re_st * r * val_time_weight * psif[q] * testf_;
3077 r * scaled_re * interpolated_dudx(1, 1) * psif[q] * testf_;
3078 for (
unsigned k = 0; k < 2; k++)
3080 double tmp2 = scaled_re * interpolated_u[k];
3083 tmp2 -= scaled_re_st * mesh_velocity[k];
3085 tmp += r * tmp2 * dpsifdx(q, k) * testf_;
3087 tmp += r * visc_ratio *
3088 (dpsifdx(q, 0) * dtestfdx(l, 0) +
3089 (1.0 +
Gamma[1]) * dpsifdx(q, 1) * dtestfdx(l, 1));
3092 sum -= d_U_dX(p, q, 1) * tmp;
3095 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
3111 for (
unsigned p = 0; p < 2; p++)
3114 for (
unsigned q = 0; q < n_node; q++)
3120 double sum = r * body_force[2] * testf_;
3123 sum += r * scaled_re_inv_fr * testf_ * G[2];
3133 (r * interpolated_dudx(2, 0) -
Gamma[0] * interpolated_u[2]) *
3136 sum -= visc_ratio * r * interpolated_dudx(2, 1) * dtestfdx(l, 1);
3140 ((interpolated_u[2] / r) -
Gamma[0] * interpolated_dudx(2, 0)) *
3144 sum -= scaled_re_st * r * dudt[2] * testf_;
3148 (r * interpolated_u[0] * interpolated_dudx(2, 0) +
3149 interpolated_u[0] * interpolated_u[2] +
3150 r * interpolated_u[1] * interpolated_dudx(2, 1)) *
3156 for (
unsigned k = 0; k < 2; k++)
3158 sum += scaled_re_st * r * mesh_velocity[k] *
3159 interpolated_dudx(2, k) * testf_;
3164 sum -= 2.0 * r * scaled_re_inv_ro * interpolated_u[0] * testf_;
3167 dresidual_dnodal_coordinates(local_eqn, p, q) +=
3168 sum * dJ_dX(p, q) * w;
3174 sum = r * d_body_force_dx(2, p) * psif[q] * testf_;
3177 sum += body_force[2] * psif[q] * testf_;
3183 sum += scaled_re_inv_fr * G[2] * psif[q] * testf_;
3189 sum -= visc_ratio * r *
3190 (d_dudx_dX(p, q, 2, 0) * dtestfdx(l, 0) +
3191 interpolated_dudx(2, 0) * d_dtestfdx_dX(p, q, l, 0) +
3192 d_dudx_dX(p, q, 2, 1) * dtestfdx(l, 1) +
3193 interpolated_dudx(2, 1) * d_dtestfdx_dX(p, q, l, 1));
3195 sum += visc_ratio *
Gamma[0] * d_dudx_dX(p, q, 2, 0) * testf_;
3200 (interpolated_dudx(2, 0) * psif[q] * dtestfdx(l, 0) +
3201 interpolated_dudx(2, 1) * psif[q] * dtestfdx(l, 1) +
3202 interpolated_u[2] * psif[q] * testf_ / (r * r));
3206 for (
unsigned k = 0; k < 2; k++)
3208 double tmp = scaled_re * interpolated_u[k];
3211 tmp -= scaled_re_st * mesh_velocity[k];
3213 sum -= r * tmp * d_dudx_dX(p, q, 2, k) * testf_;
3216 sum -= tmp * interpolated_dudx(2, k) * psif[q] * testf_;
3221 sum += scaled_re_st * r * pos_time_weight *
3222 interpolated_dudx(2, p) * psif[q] * testf_;
3228 sum -= scaled_re_st * dudt[2] * psif[q] * testf_;
3235 2.0 * scaled_re_inv_ro * interpolated_u[0] * psif[q] * testf_;
3239 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
3243 if (element_has_node_with_aux_node_update_fct)
3246 double tmp = (2.0 * r * scaled_re_inv_ro +
3247 r * scaled_re * interpolated_dudx(2, 0) -
3248 scaled_re * interpolated_u[2]) *
3252 sum = -d_U_dX(p, q, 0) * tmp;
3256 sum -= d_U_dX(p, q, 1) * scaled_re * r *
3257 interpolated_dudx(2, 1) * psif[q] * testf_;
3260 tmp = scaled_re_st * r * val_time_weight * psif[q] * testf_;
3261 tmp -= scaled_re * interpolated_u[0] * psif[q] * testf_;
3262 for (
unsigned k = 0; k < 2; k++)
3264 double tmp2 = scaled_re * interpolated_u[k];
3267 tmp2 -= scaled_re_st * mesh_velocity[k];
3269 tmp += r * tmp2 * dpsifdx(q, k) * testf_;
3271 tmp += visc_ratio * (r * dpsifdx(q, 0) -
Gamma[0] * psif[q]) *
3273 tmp += r * visc_ratio * dpsifdx(q, 1) * dtestfdx(l, 1);
3274 tmp += visc_ratio * ((psif[q] / r) -
Gamma[0] * dpsifdx(q, 0)) *
3278 sum -= d_U_dX(p, q, 2) * tmp;
3281 dresidual_dnodal_coordinates(local_eqn, p, q) += sum * J * w;
3295 for (
unsigned l = 0; l < n_pres; l++)
3300 const double testp_ = testp[l];
3306 for (
unsigned p = 0; p < 2; p++)
3309 for (
unsigned q = 0; q < n_node; q++)
3315 double aux = -r * source;
3318 aux += (interpolated_u[0] + r * interpolated_dudx(0, 0) +
3319 r * interpolated_dudx(1, 1));
3322 dresidual_dnodal_coordinates(local_eqn, p, q) +=
3323 aux * dJ_dX(p, q) * testp_ * w;
3329 aux = -r * source_gradient[p] * psif[q];
3332 aux -= source * psif[q];
3336 aux += r * (d_dudx_dX(p, q, 0, 0) + d_dudx_dX(p, q, 1, 1));
3340 (interpolated_dudx(0, 0) + interpolated_dudx(1, 1)) * psif[q];
3345 if (element_has_node_with_aux_node_update_fct)
3347 aux += d_U_dX(p, q, 0) * (psif[q] + r * dpsifdx(q, 0));
3348 aux += d_U_dX(p, q, 1) * r * dpsifdx(q, 1);
3352 dresidual_dnodal_coordinates(local_eqn, p, q) +=
3353 aux * testp_ * J * w;
3370 double*
const& parameter_pt,
3377 if (parameter_pt != this->
re_pt())
3379 std::ostringstream error_stream;
3381 <<
"Cannot compute analytic jacobian for parameter addressed by "
3382 << parameter_pt <<
"\n";
3383 error_stream <<
"Can only compute derivatives wrt Re (" <<
Re_pt <<
")\n";
3385 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3389 bool diff_re =
false;
3390 bool diff_re_st =
false;
3391 bool diff_re_inv_fr =
false;
3392 bool diff_re_inv_ro =
false;
3395 if (parameter_pt == this->
re_pt())
3399 if (parameter_pt == this->
re_st_pt())
3405 diff_re_inv_fr =
true;
3409 diff_re_inv_ro =
true;
3414 unsigned n_node =
nnode();
3420 unsigned u_nodal_index[3];
3421 for (
unsigned i = 0;
i < 3; ++
i)
3428 Shape psif(n_node), testf(n_node);
3429 DShape dpsifdx(n_node, 2), dtestfdx(n_node, 2);
3432 Shape psip(n_pres), testp(n_pres);
3451 int local_eqn = 0, local_unknown = 0;
3454 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
3463 ipt, psif, dpsifdx, testf, dtestfdx);
3477 double interpolated_p = 0.0;
3483 for (
unsigned l = 0; l < n_pres; l++)
3485 interpolated_p +=
p_axi_nst(l) * psip[l];
3491 for (
unsigned l = 0; l < n_node; l++)
3494 const double psif_ = psif(l);
3496 for (
unsigned i = 0;
i < 2;
i++)
3503 for (
unsigned i = 0;
i < 3;
i++)
3507 interpolated_u[
i] += u_value * psif_;
3510 for (
unsigned j = 0; j < 2; j++)
3512 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
3521 for (
unsigned l = 0; l < n_node; l++)
3524 for (
unsigned i = 0;
i < 2;
i++)
3551 for (
unsigned l = 0; l < n_node; l++)
3566 dres_dparam[local_eqn] += r * dens_ratio * testf[l] * G[0] *
W;
3591 dres_dparam[local_eqn] -= dens_ratio * r * dudt[0] * testf[l] *
W;
3597 dres_dparam[local_eqn] -=
3599 (r * interpolated_u[0] * interpolated_dudx(0, 0) -
3600 interpolated_u[2] * interpolated_u[2] +
3601 r * interpolated_u[1] * interpolated_dudx(0, 1)) *
3610 for (
unsigned k = 0; k < 2; k++)
3612 dres_dparam[local_eqn] += dens_ratio * r * mesh_velocity[k] *
3613 interpolated_dudx(0, k) * testf[l] *
3622 dres_dparam[local_eqn] +=
3623 2.0 * r * dens_ratio * interpolated_u[2] * testf[l] *
W;
3630 for (
unsigned l2 = 0; l2 < n_node; l2++)
3634 if (local_unknown >= 0)
3641 dmass_matrix_dparam(local_eqn, local_unknown) +=
3642 dens_ratio * r * psif[l2] * testf[l] *
W;
3661 djac_dparam(local_eqn, local_unknown) -=
3670 djac_dparam(local_eqn, local_unknown) -=
3672 (r * psif[l2] * interpolated_dudx(0, 0) +
3673 r * interpolated_u[0] * dpsifdx(l2, 0) +
3674 r * interpolated_u[1] * dpsifdx(l2, 1)) *
3681 for (
unsigned k = 0; k < 2; k++)
3685 djac_dparam(local_eqn, local_unknown) +=
3686 dens_ratio * r * mesh_velocity[k] * dpsifdx(l2, k) *
3695 if (local_unknown >= 0)
3703 djac_dparam(local_eqn, local_unknown) -=
3704 dens_ratio * r * psif[l2] * interpolated_dudx(0, 1) *
3711 if (local_unknown >= 0)
3716 djac_dparam(local_eqn, local_unknown) -=
3717 -dens_ratio * 2.0 * interpolated_u[2] * psif[l2] *
3723 djac_dparam(local_eqn, local_unknown) +=
3724 2.0 * r * dens_ratio * psif[l2] * testf[l] *
W;
3758 dres_dparam[local_eqn] += r * dens_ratio * testf[l] * G[1] *
W;
3779 dres_dparam[local_eqn] -= dens_ratio * r * dudt[1] * testf[l] *
W;
3785 dres_dparam[local_eqn] -=
3787 (r * interpolated_u[0] * interpolated_dudx(1, 0) +
3788 r * interpolated_u[1] * interpolated_dudx(1, 1)) *
3797 for (
unsigned k = 0; k < 2; k++)
3799 dres_dparam[local_eqn] += dens_ratio * r * mesh_velocity[k] *
3800 interpolated_dudx(1, k) * testf[l] *
3810 for (
unsigned l2 = 0; l2 < n_node; l2++)
3814 if (local_unknown >= 0)
3826 djac_dparam(local_eqn, local_unknown) -=
3827 dens_ratio * r * psif[l2] * interpolated_dudx(1, 0) *
3834 if (local_unknown >= 0)
3841 dmass_matrix_dparam(local_eqn, local_unknown) +=
3842 dens_ratio * r * psif[l2] * testf[l] *
W;
3862 djac_dparam(local_eqn, local_unknown) -=
3871 djac_dparam(local_eqn, local_unknown) -=
3873 (r * interpolated_u[0] * dpsifdx(l2, 0) +
3874 r * psif[l2] * interpolated_dudx(1, 1) +
3875 r * interpolated_u[1] * dpsifdx(l2, 1)) *
3882 for (
unsigned k = 0; k < 2; k++)
3886 djac_dparam(local_eqn, local_unknown) +=
3887 dens_ratio * r * mesh_velocity[k] * dpsifdx(l2, k) *
3913 dres_dparam[local_eqn] += r * dens_ratio * testf[l] * G[2] *
W;
3938 dres_dparam[local_eqn] -= dens_ratio * r * dudt[2] * testf[l] *
W;
3944 dres_dparam[local_eqn] -=
3946 (r * interpolated_u[0] * interpolated_dudx(2, 0) +
3947 interpolated_u[0] * interpolated_u[2] +
3948 r * interpolated_u[1] * interpolated_dudx(2, 1)) *
3957 for (
unsigned k = 0; k < 2; k++)
3959 dres_dparam[local_eqn] += dens_ratio * r * mesh_velocity[k] *
3960 interpolated_dudx(2, k) * testf[l] *
3969 dres_dparam[local_eqn] -=
3970 2.0 * r * dens_ratio * interpolated_u[0] * testf[l] *
W;
3977 for (
unsigned l2 = 0; l2 < n_node; l2++)
3981 if (local_unknown >= 0)
3986 djac_dparam(local_eqn, local_unknown) -=
3988 (r * psif[l2] * interpolated_dudx(2, 0) +
3989 psif[l2] * interpolated_u[2]) *
3996 djac_dparam(local_eqn, local_unknown) -=
3997 2.0 * r * dens_ratio * psif[l2] * testf[l] *
W;
4003 if (local_unknown >= 0)
4008 djac_dparam(local_eqn, local_unknown) -=
4009 dens_ratio * r * psif[l2] * interpolated_dudx(2, 1) *
4016 if (local_unknown >= 0)
4023 dmass_matrix_dparam(local_eqn, local_unknown) +=
4024 dens_ratio * r * psif[l2] * testf[l] *
W;
4047 djac_dparam(local_eqn, local_unknown) -=
4056 djac_dparam(local_eqn, local_unknown) -=
4058 (r * interpolated_u[0] * dpsifdx(l2, 0) +
4059 interpolated_u[0] * psif[l2] +
4060 r * interpolated_u[1] * dpsifdx(l2, 1)) *
4069 for (
unsigned k = 0; k < 2; k++)
4071 djac_dparam(local_eqn, local_unknown) +=
4072 dens_ratio * r * mesh_velocity[k] * dpsifdx(l2, k) *
4104 unsigned n_node =
nnode();
4107 unsigned u_nodal_index[3];
4108 for (
unsigned i = 0;
i < 3; ++
i)
4115 Shape psif(n_node), testf(n_node);
4116 DShape dpsifdx(n_node, 2), dtestfdx(n_node, 2);
4131 int local_eqn = 0, local_unknown = 0, local_freedom = 0;
4134 const unsigned n_dof = this->
ndof();
4140 for (
unsigned ipt = 0; ipt < Nintpt; ipt++)
4149 ipt, psif, dpsifdx, testf, dtestfdx);
4167 for (
unsigned l = 0; l < n_node; l++)
4170 const double psif_ = psif(l);
4172 for (
unsigned i = 0;
i < 2;
i++)
4178 for (
unsigned i = 0;
i < 3;
i++)
4182 interpolated_u[
i] += u_value * psif_;
4185 for (
unsigned j = 0; j < 2; j++)
4187 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
4196 OOMPH_CURRENT_FUNCTION,
4197 OOMPH_EXCEPTION_LOCATION);
4208 for (
unsigned l = 0; l < n_node; l++)
4216 for (
unsigned l3 = 0; l3 < n_node; l3++)
4220 if (local_freedom >= 0)
4226 for (
unsigned l2 = 0; l2 < n_node; l2++)
4230 if (local_unknown >= 0)
4234 (r * psif[l2] * dpsifdx(l3, 0) +
4235 r * psif[l3] * dpsifdx(l2, 0)) *
4236 Y[local_unknown] * testf[l] *
W;
4241 if (local_unknown >= 0)
4244 temp -= scaled_re * r * psif[l2] * dpsifdx(l3, 1) *
4245 Y[local_unknown] * testf[l] *
W;
4249 jac_y(local_eqn, local_freedom) += temp;
4255 if (local_freedom >= 0)
4260 for (
unsigned l2 = 0; l2 < n_node; l2++)
4264 if (local_unknown >= 0)
4267 temp -= scaled_re * (r * psif[l3] * dpsifdx(l2, 1)) *
4268 Y[local_unknown] * testf[l] *
W;
4272 jac_y(local_eqn, local_freedom) += temp;
4277 if (local_freedom >= 0)
4282 for (
unsigned l2 = 0; l2 < n_node; l2++)
4286 if (local_unknown >= 0)
4289 temp -= -scaled_re * 2.0 * psif[l3] * psif[l2] *
4290 Y[local_unknown] * testf[l] *
W;
4294 jac_y(local_eqn, local_freedom) += temp;
4307 for (
unsigned l3 = 0; l3 < n_node; l3++)
4311 if (local_freedom >= 0)
4316 for (
unsigned l2 = 0; l2 < n_node; l2++)
4320 if (local_unknown >= 0)
4323 temp -= scaled_re * (r * psif[l3] * dpsifdx(l2, 0)) *
4324 Y[local_unknown] * testf[l] *
W;
4327 jac_y(local_eqn, local_freedom) += temp;
4335 if (local_freedom >= 0)
4340 for (
unsigned l2 = 0; l2 < n_node; l2++)
4344 if (local_unknown >= 0)
4347 temp -= scaled_re * r * psif[l2] * dpsifdx(l3, 0) *
4348 Y[local_unknown] * testf[l] *
W;
4353 if (local_unknown >= 0)
4357 (r * psif[l2] * dpsifdx(l3, 1) +
4358 r * psif[l3] * dpsifdx(l2, 1)) *
4359 Y[local_unknown] * testf[l] *
W;
4366 jac_y(local_eqn, local_freedom) += temp;
4377 for (
unsigned l3 = 0; l3 < n_node; l3++)
4381 if (local_freedom >= 0)
4386 for (
unsigned l2 = 0; l2 < n_node; l2++)
4390 if (local_unknown >= 0)
4395 (r * psif[l3] * dpsifdx(l2, 0) + psif[l3] * psif[l2]) *
4396 Y[local_unknown] * testf[l] *
W;
4400 jac_y(local_eqn, local_freedom) += temp;
4405 if (local_freedom >= 0)
4410 for (
unsigned l2 = 0; l2 < n_node; l2++)
4414 if (local_unknown >= 0)
4417 temp -= scaled_re * (r * psif[l3] * dpsifdx(l2, 1)) *
4418 Y[local_unknown] * testf[l] *
W;
4422 jac_y(local_eqn, local_freedom) += temp;
4428 if (local_freedom >= 0)
4434 for (
unsigned l2 = 0; l2 < n_node; l2++)
4438 if (local_unknown >= 0)
4443 (r * psif[l2] * dpsifdx(l3, 0) + psif[l2] * psif[l3]) *
4444 Y[local_unknown] * testf[l] *
W;
4449 if (local_unknown >= 0)
4452 temp -= scaled_re * r * psif[l2] * dpsifdx(l3, 1) *
4453 Y[local_unknown] * testf[l] *
W;
4457 jac_y(local_eqn, local_freedom) += temp;
4469 const unsigned n_vec = C.
nrow();
4470 for (
unsigned i = 0;
i < n_dof;
i++)
4472 for (
unsigned k = 0; k < n_dof; k++)
4475 const double j_y = jac_y(
i, k);
4477 for (
unsigned v = 0; v < n_vec; v++)
4479 product(v,
i) += j_y * C(v, k);
4500 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
4503 unsigned n_node = this->
nnode();
4509 std::pair<unsigned, unsigned> dof_lookup;
4512 unsigned pressure_dof_number = 3;
4515 for (
unsigned n = 0; n < n_press; n++)
4527 dof_lookup.first = this->
eqn_number(local_eqn_number);
4528 dof_lookup.second = pressure_dof_number;
4531 dof_lookup_list.push_front(dof_lookup);
4536 for (
unsigned n = 0; n < n_node; n++)
4542 for (
unsigned v = 0; v < nv; v++)
4552 dof_lookup.first = this->
eqn_number(local_eqn_number);
4553 dof_lookup.second = v;
4556 dof_lookup_list.push_front(dof_lookup);
4567 {3, 3, 3, 3, 3, 3, 3, 3, 3};
4605 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
4608 unsigned n_node = this->
nnode();
4611 std::pair<unsigned, unsigned> dof_lookup;
4614 for (
unsigned n = 0; n < n_node; n++)
4620 for (
unsigned v = 0; v < nv; v++)
4632 dof_lookup.first = this->
eqn_number(local_eqn_number);
4635 dof_lookup.second = v;
4638 dof_lookup_list.push_front(dof_lookup);
4649 4, 3, 4, 3, 3, 3, 4, 3, 4};
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...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
unsigned long nrow() const
Return the number of rows of the matrix.
unsigned long ncol() const
Return the number of columns of the matrix.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
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.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
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...
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
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"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
virtual void get_source_fct_gradient(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
Get gradient of source term at (Eulerian) position x. Computed via function pointer (if set) or by fi...
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
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,...
static bool Pre_multiply_by_viscosity_ratio
Static boolean telling us whether we pre-multiply the pressure and continuity by the viscosity ratio.
const double & re_invro() const
Global Reynolds number multiplied by inverse Rossby number.
virtual unsigned u_index_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
virtual int p_local_eqn(const unsigned &n) const =0
Access function for the local equation number information for the pressure. p_local_eqn[n] = local eq...
virtual void fill_in_generic_dresidual_contribution_axi_nst(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam, unsigned flag)
Compute the derivative of residuals for the Navier–Stokes equations; with respect to a parameeter fla...
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(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
double dissipation() const
Return integral of dissipation 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....
const double & viscosity_ratio() const
Viscosity ratio for element: Element's viscosity relative to the viscosity used in the definition of ...
double kin_energy() const
Get integral of kinetic energy over element.
virtual void extrapolated_strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Extrapolated strain-rate tensor: where (in that order) based on the previous time steps evaluated a...
double pressure_integral() const
Integral of pressure over element.
virtual void pshape_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
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.
virtual unsigned npres_axi_nst() const =0
Function to return number of pressure degrees of freedom.
void max_and_min_invariant_and_viscosity(double &min_invariant, double &max_invariant, double &min_viscosity, double &max_viscosity) const
Get max. and min. strain rate invariant and visocosity over all integration points in element.
const double & re_invfr() const
Global inverse Froude number.
bool Use_extrapolated_strainrate_to_compute_second_invariant
GeneralisedNewtonianConstitutiveEquation< 3 > * Constitutive_eqn_pt
Pointer to the generalised Newtonian constitutive equation.
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector.
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...
double * Re_pt
Pointer to global Reynolds number.
const double & re() const
Reynolds number.
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
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....
double du_dt_axi_nst(const unsigned &n, const unsigned &i) const
i-th component of du/dt at local node n. Uses suitably interpolated value for hanging nodes.
double get_source_fct(const double &time, const unsigned &ipt, const Vector< double > &x)
Calculate the source fct at given time and Eulerian position.
void traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction) const
Compute traction (on the viscous scale) at local coordinate s for outer unit normal N.
virtual void get_viscosity_ratio_axisym_nst(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, double &visc_ratio)
Calculate the viscosity ratio relative to the viscosity used in the definition of the Reynolds number...
virtual void get_body_force_axi_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Calculate the body force fct at a given time and Eulerian position.
double *& re_invro_pt()
Pointer to global inverse Froude number.
virtual double p_axi_nst(const unsigned &n_p) const =0
Pressure at local pressure "node" n_p Uses suitably interpolated value for hanging nodes.
double *& re_invfr_pt()
Pointer to global inverse Froude number.
double interpolated_p_axi_nst(const Vector< double > &s) const
Return FE interpolated pressure 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 void fill_in_generic_residual_contribution_axi_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations; flag=2 or 1 or 0: compute the Jacobian and/or ...
virtual double dshape_and_dtest_eulerian_at_knot_axi_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and derivatives w.r.t. global coords at ipt-th integration point Return J...
double *& re_pt()
Pointer to Reynolds number.
const Vector< double > & g() const
Vector of gravitational components.
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed....
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: where (in that order)
virtual void get_body_force_gradient_axi_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, DenseMatrix< double > &d_body_force_dx)
Get gradient of body force term at (Eulerian) position x. Computed via function pointer (if set) or b...
void interpolated_u_axi_nst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction) const
Compute traction at local coordinate s for outer unit normal N.
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...
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
int p_local_eqn(const unsigned &n) const
Overload the access function for the pressure's local equation numbers.
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n.
unsigned npres_axi_nst() const
Return number of pressure values.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction) const
Compute traction at local coordinate s for outer unit normal N.
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...
virtual double viscosity(const double &second_invariant_of_rate_of_strain_tensor)=0
Function implementing the constitutive model Input: second invariant of the rate of strain Output: th...
virtual double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)=0
Function returning the derivative of the viscosity w.r.t. the second invariant of the rate of strain ...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
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.
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...
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
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....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
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.
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).
double & time()
Return the current value of the continuous time.
double second_invariant(const DenseMatrix< double > &tensor)
Compute second invariant of tensor.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...