47 int GeneralisedNewtonianAxisymmetricNavierStokesEquations::
48 Pressure_not_stored_at_node = -100;
51 double GeneralisedNewtonianAxisymmetricNavierStokesEquations::
52 Default_Physical_Constant_Value = 0.0;
55 double GeneralisedNewtonianAxisymmetricNavierStokesEquations::
56 Default_Physical_Ratio_Value = 1.0;
64 bool GeneralisedNewtonianAxisymmetricNavierStokesEquations::
65 Pre_multiply_by_viscosity_ratio =
false;
79 const unsigned& which_one)
83 if ((which_one==0)||(which_one==1))
86 "Computation of diagonal of pressure mass matrix is not impmented yet.\n",
87 OOMPH_CURRENT_FUNCTION,
88 OOMPH_EXCEPTION_LOCATION);
93 veloc_mass_diag.assign(
ndof(), 0.0);
96 const unsigned n_node =
nnode();
99 const unsigned n_value = 3;
103 for(
unsigned i=0;
i<n_value;
i++)
118 for(
unsigned ipt=0; ipt<n_intpt; ipt++)
136 for(
unsigned l=0;l<n_node;l++)
145 for(
unsigned l=0; l<n_node; l++)
148 for(
unsigned i=0;
i<n_value;
i++)
156 veloc_mass_diag[local_eqn] += test[l]*test[l] *
W;
175 double& error,
double& norm)
189 outfile <<
"ZONE" << std::endl;
195 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
213 (*exact_soln_pt)(time,x,exact_soln);
216 for(
unsigned i=0;
i<3;
i++)
218 norm+=exact_soln[
i]*exact_soln[
i]*
W;
224 for(
unsigned i=0;
i<2;
i++) {outfile << x[
i] <<
" ";}
227 for(
unsigned i=0;
i<3;
i++)
230 outfile << std::endl;
243 double& error,
double& norm)
257 outfile <<
"ZONE" << std::endl;
263 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
282 (*exact_soln_pt)(x,exact_soln);
285 for(
unsigned i=0;
i<3;
i++)
287 norm+=exact_soln[
i]*exact_soln[
i]*
W;
293 for(
unsigned i=0;
i<2;
i++) {outfile << x[
i] <<
" ";}
296 for(
unsigned i=0;
i<3;
i++)
299 outfile << std::endl;
311 const unsigned &nplot,
329 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
339 (*exact_soln_pt)(x,exact_soln);
342 for(
unsigned i=0;
i<2;
i++)
344 outfile << x[
i] <<
" ";
348 for(
unsigned i=0;
i<exact_soln.size();
i++)
350 outfile << exact_soln[
i] <<
" ";
353 outfile << std::endl;
370 const unsigned &nplot,
389 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
399 (*exact_soln_pt)(time,x,exact_soln);
402 for(
unsigned i=0;
i<2;
i++)
404 outfile << x[
i] <<
" ";
408 for(
unsigned i=0;
i<exact_soln.size();
i++)
410 outfile << exact_soln[
i] <<
" ";
413 outfile << std::endl;
431 const unsigned &nplot,
435 unsigned n_node =
nnode();
451 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
461 for(
unsigned i=0;
i<2;
i++)
463 interpolated_x[
i]=0.0;
465 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++)
477 {interpolated_u[
i] +=
nodal_value(t,l,u_nodal_index)*psi[l];}
481 for(
unsigned i=0;
i<2;
i++) {outfile << interpolated_x[
i] <<
" ";}
484 for(
unsigned i=0;
i<3;
i++) {outfile << interpolated_u[
i] <<
" ";}
486 outfile << std::endl;
501 output(std::ostream &outfile,
const unsigned &nplot)
511 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
526 outfile << std::endl;
528 outfile << std::endl;
543 output(FILE* file_pt,
const unsigned &nplot)
553 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
560 for(
unsigned i=0;
i<2;
i++)
567 for(
unsigned i=0;
i<3;
i++)
578 fprintf(file_pt,
"\n");
581 fprintf(file_pt,
"\n");
598 "Check the dissipation calculation for axisymmetric NSt",
599 OOMPH_CURRENT_FUNCTION,
600 OOMPH_EXCEPTION_LOCATION);
612 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
616 for(
unsigned i=0;
i<2;
i++)
632 double local_diss=0.0;
633 for(
unsigned i=0;
i<3;
i++)
635 for(
unsigned j=0;j<3;j++)
637 local_diss+=2.0*strainrate(
i,j)*strainrate(
i,j);
641 diss+=local_diss*w*J;
668 if ((N.size()==3)&&(N[2]!=0.0))
671 "Unit normal passed into this fct should either be 2D (r,z) or have a zero component in the theta-direction",
672 OOMPH_CURRENT_FUNCTION,
673 OOMPH_EXCEPTION_LOCATION);
700 for (
unsigned i=0;
i<3;
i++)
702 traction[
i]=-press*n_local[
i];
703 for (
unsigned j=0;j<3;j++)
705 traction[
i]+=visc*2.0*strainrate(
i,j)*n_local[j];
717 "Check the dissipation calculation for axisymmetric NSt",
718 OOMPH_CURRENT_FUNCTION,
719 OOMPH_EXCEPTION_LOCATION);
726 double local_diss=0.0;
727 for(
unsigned i=0;
i<3;
i++)
729 for(
unsigned j=0;j<3;j++)
731 local_diss+=2.0*strainrate(
i,j)*strainrate(
i,j);
747 if ((strainrate.
ncol()!=3)||(strainrate.
nrow()!=3))
749 std::ostringstream error_message;
750 error_message <<
"The strain rate has incorrect dimensions " 751 << strainrate.
ncol() <<
" x " 752 << strainrate.
nrow() <<
" Not 3" << std::endl;
755 OOMPH_CURRENT_FUNCTION,
756 OOMPH_EXCEPTION_LOCATION);
761 unsigned n_node =
nnode();
771 double interpolated_r = 0.0;
785 unsigned u_nodal_index[3];
790 for(
unsigned l=0;l<n_node;l++)
798 durdr +=
nodal_value(l,u_nodal_index[0])*dpsidx(l,0);
799 durdz +=
nodal_value(l,u_nodal_index[0])*dpsidx(l,1);
801 duzdr +=
nodal_value(l,u_nodal_index[1])*dpsidx(l,0);
802 duzdz +=
nodal_value(l,u_nodal_index[1])*dpsidx(l,1);
804 duphidr +=
nodal_value(l,u_nodal_index[2])*dpsidx(l,0);
805 duphidz +=
nodal_value(l,u_nodal_index[2])*dpsidx(l,1);
811 strainrate(0,0)=durdr;
812 strainrate(0,1)=0.5*(durdz+duzdr);
813 strainrate(1,0)=strainrate(0,1);
815 strainrate(2,0)=strainrate(0,2);
816 strainrate(1,1)=duzdz;
817 strainrate(1,2)=0.5*duphidz;
818 strainrate(2,1)=strainrate(1,2);
824 if (std::fabs(interpolated_r)>1.0
e-16)
826 double inverse_radius=1.0/interpolated_r;
827 strainrate(0,2)=0.5*(duphidr-inverse_radius*uphi);
828 strainrate(2,0)=strainrate(0,2);
829 strainrate(2,2)=inverse_radius*ur;
834 strainrate(2,2)=durdr;
849 if ((strainrate.
ncol()!=3)||(strainrate.
nrow()!=3))
851 std::ostringstream error_message;
852 error_message <<
"The strain rate has incorrect dimensions " 853 << strainrate.
ncol() <<
" x " 854 << strainrate.
nrow() <<
" Not 3" << std::endl;
857 "GeneralisedNewtonianAxisymmetricNavierStokeEquations::strain_rate()",
858 OOMPH_EXCEPTION_LOCATION);
863 unsigned n_node =
nnode();
872 for (
unsigned j=0;j<n_node;j++)
874 backed_up_nodal_position(j,0)=
node_pt(j)->
x(0);
876 backed_up_nodal_position(j,1)=
node_pt(j)->
x(1);
884 double interpolated_r = 0.0;
885 double interpolated_z = 0.0;
899 unsigned u_nodal_index[3];
904 for(
unsigned l=0;l<n_node;l++)
913 durdr +=
nodal_value(t,l,u_nodal_index[0])*dpsidx(l,0);
914 durdz +=
nodal_value(t,l,u_nodal_index[0])*dpsidx(l,1);
916 duzdr +=
nodal_value(t,l,u_nodal_index[1])*dpsidx(l,0);
917 duzdz +=
nodal_value(t,l,u_nodal_index[1])*dpsidx(l,1);
919 duphidr +=
nodal_value(t,l,u_nodal_index[2])*dpsidx(l,0);
920 duphidz +=
nodal_value(t,l,u_nodal_index[2])*dpsidx(l,1);
926 strainrate(0,0)=durdr;
927 strainrate(0,1)=0.5*(durdz+duzdr);
928 strainrate(1,0)=strainrate(0,1);
930 strainrate(2,0)=strainrate(0,2);
931 strainrate(1,1)=duzdz;
932 strainrate(1,2)=0.5*duphidz;
933 strainrate(2,1)=strainrate(1,2);
939 if (std::fabs(interpolated_r)>1.0
e-16)
941 double inverse_radius=1.0/interpolated_r;
942 strainrate(0,2)=0.5*(duphidr-inverse_radius*uphi);
943 strainrate(2,0)=strainrate(0,2);
944 strainrate(2,2)=inverse_radius*ur;
949 strainrate(2,2)=durdr;
953 for (
unsigned j=0;j<n_node;j++)
955 node_pt(j)->
x(0)=backed_up_nodal_position(j,0);
956 node_pt(j)->
x(1)=backed_up_nodal_position(j,1);
971 if ((strainrate.
ncol()!=3)||(strainrate.
nrow()!=3))
973 std::ostringstream error_message;
974 error_message <<
"The strain rate has incorrect dimensions " 975 << strainrate.
ncol() <<
" x " 976 << strainrate.
nrow() <<
" Not 3" << std::endl;
979 OOMPH_CURRENT_FUNCTION,
980 OOMPH_EXCEPTION_LOCATION);
995 double dt_current=time_stepper_pt->
time_pt()->
dt(0);
996 double dt_prev=time_stepper_pt->
time_pt()->
dt(1);
999 for (
unsigned i=0;
i<3;
i++)
1001 for (
unsigned j=0;j<3;j++)
1004 double slope=(strain_rate_minus_one(
i,j)-strain_rate_minus_two(
i,j))/
1008 strainrate(
i,j)=strain_rate_minus_one(
i,j)+slope*dt_current;
1020 "Check the kinetic energy calculation for axisymmetric NSt",
1021 OOMPH_CURRENT_FUNCTION,
1022 OOMPH_EXCEPTION_LOCATION);
1034 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
1046 double veloc_squared=0.0;
1047 for(
unsigned i=0;
i<3;
i++)
1076 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
1080 for(
unsigned i=0;
i<2;
i++)
1112 double& max_invariant,
1113 double& min_viscosity,
1114 double& max_viscosity)
const 1117 min_invariant=DBL_MAX;
1118 max_invariant=-DBL_MAX;
1119 min_viscosity=DBL_MAX;
1120 max_viscosity=-DBL_MAX;
1129 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
1145 min_invariant=std::min(min_invariant,second_invariant);
1146 max_invariant=std::max(max_invariant,second_invariant);
1147 min_viscosity=std::min(min_viscosity,viscosity);
1148 max_viscosity=std::max(max_viscosity,viscosity);
1167 if (
ndof()==0)
return;
1170 unsigned n_node =
nnode();
1179 unsigned u_nodal_index[3];
1184 Shape psif(n_node), testf(n_node);
1185 DShape dpsifdx(n_node,2), dtestfdx(n_node,2);
1188 Shape psip(n_pres), testp(n_pres);
1206 int local_eqn=0, local_unknown=0;
1209 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
1232 double interpolated_p=0.0;
1238 for(
unsigned l=0;l<n_pres;l++) {interpolated_p +=
p_axi_nst(l)*psip[l];}
1243 for(
unsigned l=0;l<n_node;l++)
1246 const double psif_ = psif(l);
1248 for(
unsigned i=0;
i<2;
i++)
1254 for(
unsigned i=0;
i<3;
i++)
1258 interpolated_u[
i] += u_value*psif_;
1261 for(
unsigned j=0;j<2;j++)
1262 {interpolated_dudx(i,j) += u_value*dpsifdx(l,j);}
1270 for(
unsigned l=0;l<n_node;l++)
1273 for(
unsigned i=0;
i<2;
i++)
1288 strain_rate(s,strainrate_to_compute_second_invariant);
1297 strainrate_to_compute_second_invariant);
1317 double r = interpolated_x[0];
1328 double dviscosity_dsecond_invariant=
1343 dinvariant_dstrainrate(0,0)=strainrate_ref(1,1)+strainrate_ref(2,2);
1345 dinvariant_dstrainrate(1,1)=strainrate_ref(0,0)+strainrate_ref(2,2);
1347 dinvariant_dstrainrate(2,2)=strainrate_ref(0,0)+strainrate_ref(1,1);
1349 dinvariant_dstrainrate(0,1)=-strainrate_ref(1,0);
1351 dinvariant_dstrainrate(1,0)=-strainrate_ref(0,1);
1353 dinvariant_dstrainrate(0,2)=-strainrate_ref(2,0);
1355 dinvariant_dstrainrate(2,0)=-strainrate_ref(0,2);
1357 dinvariant_dstrainrate(2,1)=-strainrate_ref(1,2);
1359 dinvariant_dstrainrate(1,2)=-strainrate_ref(2,1);
1362 for(
unsigned l=0;l<n_node;l++)
1368 for(
unsigned i=0;
i<3;
i++)
1383 double dinvariant_dunknown=0.0;
1386 for(
unsigned m=0;m<3;m++)
1388 for(
unsigned n=0;n<3;n++)
1393 double dstrainrate_dunknown=0.0;
1408 dstrainrate_dunknown=dpsifdx(l,0);
1416 dstrainrate_dunknown=0.5*dpsifdx(l,1);
1420 dstrainrate_dunknown=0.5*dpsifdx(l,0);
1428 dstrainrate_dunknown=0.5*dpsifdx(l,0)-0.5/r*psif[l];
1433 std::ostringstream error_stream;
1434 error_stream <<
"Should never get here...";
1437 OOMPH_CURRENT_FUNCTION,
1438 OOMPH_EXCEPTION_LOCATION);
1454 dstrainrate_dunknown=0.5*dpsifdx(l,1);
1458 dstrainrate_dunknown=0.5*dpsifdx(l,0);
1466 dstrainrate_dunknown=dpsifdx(l,1);
1478 dstrainrate_dunknown=0.5*dpsifdx(l,1);
1483 std::ostringstream error_stream;
1484 error_stream <<
"Should never get here...";
1487 OOMPH_CURRENT_FUNCTION,
1488 OOMPH_EXCEPTION_LOCATION);
1504 dstrainrate_dunknown=0.5*dpsifdx(l,0)-0.5/r*psif[l];
1512 dstrainrate_dunknown=0.5*dpsifdx(l,1);
1520 dstrainrate_dunknown=1.0/r*psif[l];
1525 std::ostringstream error_stream;
1526 error_stream <<
"Should never get here...";
1529 OOMPH_CURRENT_FUNCTION,
1530 OOMPH_EXCEPTION_LOCATION);
1537 std::ostringstream error_stream;
1538 error_stream <<
"Should never get here...";
1541 OOMPH_CURRENT_FUNCTION,
1542 OOMPH_EXCEPTION_LOCATION);
1549 dinvariant_dunknown += dinvariant_dstrainrate(m,n)*
1550 dstrainrate_dunknown;
1565 dviscosity_dUr[l] = dviscosity_dsecond_invariant*dinvariant_dunknown;
1569 dviscosity_dUz[l] = dviscosity_dsecond_invariant*dinvariant_dunknown;
1573 dviscosity_dUphi[l] = dviscosity_dsecond_invariant*
1574 dinvariant_dunknown;
1578 std::ostringstream error_stream;
1579 error_stream <<
"Should never get here...";
1582 OOMPH_CURRENT_FUNCTION,
1583 OOMPH_EXCEPTION_LOCATION);
1596 for(
unsigned l=0;l<n_node;l++)
1604 residuals[local_eqn] +=
1605 r*body_force[0]*testf[l]*
W;
1608 residuals[local_eqn] += r*scaled_re_inv_fr*testf[l]*G[0]*
W;
1614 residuals[local_eqn] +=
1615 visc_ratio*viscosity*interpolated_p*(testf[l] + r*dtestfdx(l,0))*W;
1619 residuals[local_eqn] +=
1620 interpolated_p*(testf[l] + r*dtestfdx(l,0))*W;
1628 residuals[local_eqn] -= visc_ratio*viscosity*
1629 r*(1.0+
Gamma[0])*interpolated_dudx(0,0)*dtestfdx(l,0)*
W;
1632 residuals[local_eqn] -= visc_ratio*viscosity*r*
1633 (interpolated_dudx(0,1) +
Gamma[0]*interpolated_dudx(1,0))*
1637 residuals[local_eqn] -=
1638 visc_ratio*viscosity*(1.0 +
Gamma[0])*interpolated_u[0]*testf[l]*W/r;
1642 residuals[local_eqn] -= scaled_re_st*r*dudt[0]*testf[l]*
W;
1645 residuals[local_eqn] -=
1646 scaled_re*(r*interpolated_u[0]*interpolated_dudx(0,0)
1647 - interpolated_u[2]*interpolated_u[2]
1648 + r*interpolated_u[1]*interpolated_dudx(0,1))*testf[l]*W;
1653 for(
unsigned k=0;k<2;k++)
1655 residuals[local_eqn] +=
1656 scaled_re_st*r*mesh_velocity[k]*interpolated_dudx(0,k)*testf[l]*
W;
1661 residuals[local_eqn] +=
1662 2.0*r*scaled_re_inv_ro*interpolated_u[2]*testf[l]*
W;
1668 for(
unsigned l2=0;l2<n_node;l2++)
1672 if(local_unknown >= 0)
1677 mass_matrix(local_eqn,local_unknown) +=
1678 scaled_re_st*r*psif[l2]*testf[l]*
W;
1682 jacobian(local_eqn,local_unknown)
1683 -= visc_ratio*viscosity*r*(1.0+
Gamma[0])
1684 *dpsifdx(l2,0)*dtestfdx(l,0)*
W;
1689 jacobian(local_eqn,local_unknown)
1690 -= visc_ratio*dviscosity_dUr[l2]*
1691 r*(1.0+
Gamma[0])*interpolated_dudx(0,0)*dtestfdx(l,0)*
W;
1695 jacobian(local_eqn,local_unknown)
1696 -= visc_ratio*viscosity*r*dpsifdx(l2,1)*dtestfdx(l,1)*
W;
1701 jacobian(local_eqn,local_unknown)
1702 -= visc_ratio*dviscosity_dUr[l2]*
1703 r*(interpolated_dudx(0,1) +
Gamma[0]*interpolated_dudx(1,0))*
1708 jacobian(local_eqn,local_unknown)
1709 -= visc_ratio*viscosity*(1.0 +
Gamma[0])*psif[l2]*testf[l]*W/r;
1714 jacobian(local_eqn,local_unknown)
1715 -= visc_ratio*dviscosity_dUr[l2]*
1716 (1.0 +
Gamma[0])*interpolated_u[0]*testf[l]*W/r;
1721 jacobian(local_eqn,local_unknown)
1723 psif[l2]*testf[l]*
W;
1726 jacobian(local_eqn,local_unknown) -=
1727 scaled_re*(r*psif[l2]*interpolated_dudx(0,0)
1728 + r*interpolated_u[0]*dpsifdx(l2,0)
1729 + r*interpolated_u[1]*dpsifdx(l2,1))*testf[l]*W;
1734 for(
unsigned k=0;k<2;k++)
1736 jacobian(local_eqn,local_unknown) +=
1737 scaled_re_st*r*mesh_velocity[k]*dpsifdx(l2,k)*testf[l]*
W;
1745 if(local_unknown >= 0)
1753 jacobian(local_eqn,local_unknown)
1754 -= visc_ratio*dviscosity_dUz[l2]*
1755 r*(1.0+
Gamma[0])*interpolated_dudx(0,0)*dtestfdx(l,0)*
W;
1759 jacobian(local_eqn,local_unknown) -=
1760 visc_ratio*viscosity*r*
Gamma[0]*dpsifdx(l2,0)*dtestfdx(l,1)*
W;
1765 jacobian(local_eqn,local_unknown) -=
1766 visc_ratio*dviscosity_dUz[l2]*
1767 r*(interpolated_dudx(0,1) +
Gamma[0]*interpolated_dudx(1,0))*
1776 jacobian(local_eqn,local_unknown)
1777 -= visc_ratio*dviscosity_dUz[l2]*
1778 (1.0 +
Gamma[0])*interpolated_u[0]*testf[l]*W/r;
1782 jacobian(local_eqn,local_unknown) -=
1783 scaled_re*r*psif[l2]*interpolated_dudx(0,1)*testf[l]*
W;
1788 if(local_unknown >= 0)
1796 jacobian(local_eqn,local_unknown)
1797 -= visc_ratio*dviscosity_dUphi[l2]*
1798 r*(1.0+
Gamma[0])*interpolated_dudx(0,0)*dtestfdx(l,0)*
W;
1806 jacobian(local_eqn,local_unknown) -=
1807 visc_ratio*dviscosity_dUphi[l2]*
1808 r*(interpolated_dudx(0,1) +
Gamma[0]*interpolated_dudx(1,0))*
1817 jacobian(local_eqn,local_unknown)
1818 -= visc_ratio*dviscosity_dUphi[l2]*
1819 (1.0 +
Gamma[0])*interpolated_u[0]*testf[l]*W/r;
1823 jacobian(local_eqn,local_unknown) -=
1824 - scaled_re*2.0*interpolated_u[2]*psif[l2]*testf[l]*
W;
1827 jacobian(local_eqn,local_unknown) +=
1828 2.0*r*scaled_re_inv_ro*psif[l2]*testf[l]*
W;
1835 for(
unsigned l2=0;l2<n_pres;l2++)
1839 if(local_unknown >= 0)
1843 jacobian(local_eqn,local_unknown)
1844 += visc_ratio*viscosity*psip[l2]*(testf[l] + r*dtestfdx(l,0))*W;
1848 jacobian(local_eqn,local_unknown)
1849 += psip[l2]*(testf[l] + r*dtestfdx(l,0))*W;
1864 residuals[local_eqn] +=
1865 r*body_force[1]*testf[l]*
W;
1868 residuals[local_eqn] += r*scaled_re_inv_fr*testf[l]*G[1]*
W;
1874 residuals[local_eqn] += r*visc_ratio*viscosity*interpolated_p*
1879 residuals[local_eqn] += r*interpolated_p*dtestfdx(l,1)*
W;
1887 residuals[local_eqn] -= visc_ratio*viscosity*
1888 r*(interpolated_dudx(1,0) +
Gamma[1]*interpolated_dudx(0,1))
1892 residuals[local_eqn] -= visc_ratio*viscosity*r*
1893 (1.0 +
Gamma[1])*interpolated_dudx(1,1)*dtestfdx(l,1)*
W;
1897 residuals[local_eqn] -= scaled_re_st*r*dudt[1]*testf[l]*
W;
1900 residuals[local_eqn] -=
1901 scaled_re*(r*interpolated_u[0]*interpolated_dudx(1,0)
1902 + r*interpolated_u[1]*interpolated_dudx(1,1))*testf[l]*W;
1907 for(
unsigned k=0;k<2;k++)
1909 residuals[local_eqn] +=
1910 scaled_re_st*r*mesh_velocity[k]*interpolated_dudx(1,k)*testf[l]*
W;
1918 for(
unsigned l2=0;l2<n_node;l2++)
1922 if(local_unknown >= 0)
1929 jacobian(local_eqn,local_unknown) -=
1930 visc_ratio*viscosity*r*
Gamma[1]*dpsifdx(l2,1)*dtestfdx(l,0)*
W;
1935 jacobian(local_eqn,local_unknown) -=
1936 visc_ratio*dviscosity_dUr[l2]*
1937 r*(interpolated_dudx(1,0) +
Gamma[1]*interpolated_dudx(0,1))
1946 jacobian(local_eqn,local_unknown) -=
1947 visc_ratio*dviscosity_dUr[l2]*
1948 r*(1.0 +
Gamma[1])*interpolated_dudx(1,1)*dtestfdx(l,1)*
W;
1952 jacobian(local_eqn,local_unknown) -=
1953 scaled_re*r*psif[l2]*interpolated_dudx(1,0)*testf[l]*
W;
1958 if(local_unknown >= 0)
1963 mass_matrix(local_eqn,local_unknown) +=
1964 scaled_re_st*r*psif[l2]*testf[l]*
W;
1972 jacobian(local_eqn,local_unknown) -=
1973 visc_ratio*viscosity*r*dpsifdx(l2,0)*dtestfdx(l,0)*
W;
1978 jacobian(local_eqn,local_unknown) -=
1979 visc_ratio*dviscosity_dUz[l2]*
1980 r*(interpolated_dudx(1,0) +
Gamma[1]*interpolated_dudx(0,1))
1985 jacobian(local_eqn,local_unknown) -=
1986 visc_ratio*viscosity*r*(1.0 +
Gamma[1])*dpsifdx(l2,1)*
1992 jacobian(local_eqn,local_unknown) -=
1993 visc_ratio*dviscosity_dUz[l2]*
1994 r*(1.0 +
Gamma[1])*interpolated_dudx(1,1)*dtestfdx(l,1)*
W;
1999 jacobian(local_eqn,local_unknown) -=
2001 psif[l2]*testf[l]*
W;
2004 jacobian(local_eqn,local_unknown) -=
2005 scaled_re*(r*interpolated_u[0]*dpsifdx(l2,0)
2006 + r*psif[l2]*interpolated_dudx(1,1)
2007 + r*interpolated_u[1]*dpsifdx(l2,1))*testf[l]*W;
2013 for(
unsigned k=0;k<2;k++)
2015 jacobian(local_eqn,local_unknown) +=
2016 scaled_re_st*r*mesh_velocity[k]*dpsifdx(l2,k)*testf[l]*
W;
2025 if(local_unknown >= 0)
2030 jacobian(local_eqn,local_unknown) -=
2031 visc_ratio*dviscosity_dUphi[l2]*
2032 r*(interpolated_dudx(1,0) +
Gamma[1]*interpolated_dudx(0,1))
2036 jacobian(local_eqn,local_unknown) -=
2037 visc_ratio*dviscosity_dUphi[l2]*
2038 r*(1.0 +
Gamma[1])*interpolated_dudx(1,1)*dtestfdx(l,1)*
W;
2046 for(
unsigned l2=0;l2<n_pres;l2++)
2050 if(local_unknown >= 0)
2054 jacobian(local_eqn,local_unknown)
2055 += r*visc_ratio*viscosity*psip[l2]*dtestfdx(l,1)*
W;
2059 jacobian(local_eqn,local_unknown)
2060 += r*psip[l2]*dtestfdx(l,1)*
W;
2074 residuals[local_eqn] +=
2075 r*body_force[2]*testf[l]*
W;
2078 residuals[local_eqn] += r*scaled_re_inv_fr*testf[l]*G[2]*
W;
2087 residuals[local_eqn] -= visc_ratio*viscosity*
2088 (r*interpolated_dudx(2,0) -
2089 Gamma[0]*interpolated_u[2])*dtestfdx(l,0)*
W;
2092 residuals[local_eqn] -= visc_ratio*viscosity*r*
2093 interpolated_dudx(2,1)*dtestfdx(l,1)*
W;
2096 residuals[local_eqn] -= visc_ratio*viscosity*
2097 ((interpolated_u[2]/r) -
Gamma[0]*interpolated_dudx(2,0))*testf[l]*W;
2102 residuals[local_eqn] -= scaled_re_st*r*dudt[2]*testf[l]*
W;
2105 residuals[local_eqn] -=
2106 scaled_re*(r*interpolated_u[0]*interpolated_dudx(2,0)
2107 + interpolated_u[0]*interpolated_u[2]
2108 + r*interpolated_u[1]*interpolated_dudx(2,1))*testf[l]*W;
2113 for(
unsigned k=0;k<2;k++)
2115 residuals[local_eqn] +=
2116 scaled_re_st*r*mesh_velocity[k]*interpolated_dudx(2,k)*testf[l]*
W;
2121 residuals[local_eqn] -=
2122 2.0*r*scaled_re_inv_ro*interpolated_u[0]*testf[l]*
W;
2128 for(
unsigned l2=0;l2<n_node;l2++)
2132 if(local_unknown >= 0)
2137 jacobian(local_eqn,local_unknown) -=
2138 visc_ratio*dviscosity_dUr[l2]*
2139 (r*interpolated_dudx(2,0) -
2140 Gamma[0]*interpolated_u[2])*dtestfdx(l,0)*
W;
2143 jacobian(local_eqn,local_unknown) -=
2144 visc_ratio*dviscosity_dUr[l2]*
2145 r*interpolated_dudx(2,1)*dtestfdx(l,1)*
W;
2148 jacobian(local_eqn,local_unknown) -=
2149 visc_ratio*dviscosity_dUr[l2]*
2150 ((interpolated_u[2]/r) -
Gamma[0]*interpolated_dudx(2,0))*
2155 jacobian(local_eqn,local_unknown) -=
2156 scaled_re*(r*psif[l2]*interpolated_dudx(2,0)
2157 + psif[l2]*interpolated_u[2])*testf[l]*W;
2160 jacobian(local_eqn,local_unknown) -=
2161 2.0*r*scaled_re_inv_ro*psif[l2]*testf[l]*
W;
2166 if(local_unknown >= 0)
2171 jacobian(local_eqn,local_unknown) -=
2172 visc_ratio*dviscosity_dUz[l2]*
2173 (r*interpolated_dudx(2,0) -
2174 Gamma[0]*interpolated_u[2])*dtestfdx(l,0)*
W;
2177 jacobian(local_eqn,local_unknown) -=
2178 visc_ratio*dviscosity_dUz[l2]*
2179 r*interpolated_dudx(2,1)*dtestfdx(l,1)*
W;
2182 jacobian(local_eqn,local_unknown) -=
2183 visc_ratio*dviscosity_dUz[l2]*
2184 ((interpolated_u[2]/r) -
Gamma[0]*interpolated_dudx(2,0))*
2189 jacobian(local_eqn,local_unknown) -=
2190 scaled_re*r*psif[l2]*interpolated_dudx(2,1)*testf[l]*
W;
2195 if(local_unknown >= 0)
2200 mass_matrix(local_eqn,local_unknown) +=
2201 scaled_re_st*r*psif[l2]*testf[l]*
W;
2209 jacobian(local_eqn,local_unknown) -=
2210 visc_ratio*viscosity*(r*dpsifdx(l2,0) -
2211 Gamma[0]*psif[l2])*dtestfdx(l,0)*
W;
2216 jacobian(local_eqn,local_unknown) -=
2217 visc_ratio*dviscosity_dUphi[l2]*
2218 (r*interpolated_dudx(2,0) -
2219 Gamma[0]*interpolated_u[2])*dtestfdx(l,0)*
W;
2223 jacobian(local_eqn,local_unknown) -=
2224 visc_ratio*viscosity*r*dpsifdx(l2,1)*dtestfdx(l,1)*
W;
2229 jacobian(local_eqn,local_unknown) -=
2230 visc_ratio*dviscosity_dUphi[l2]*
2231 r*interpolated_dudx(2,1)*dtestfdx(l,1)*
W;
2235 jacobian(local_eqn,local_unknown) -=
2236 visc_ratio*viscosity*((psif[l2]/r) -
Gamma[0]*dpsifdx(l2,0))
2242 jacobian(local_eqn,local_unknown) -=
2243 visc_ratio*dviscosity_dUphi[l2]*
2244 ((interpolated_u[2]/r) -
Gamma[0]*interpolated_dudx(2,0))*
2250 jacobian(local_eqn,local_unknown) -=
2252 psif[l2]*testf[l]*
W;
2255 jacobian(local_eqn,local_unknown) -=
2256 scaled_re*(r*interpolated_u[0]*dpsifdx(l2,0)
2257 + interpolated_u[0]*psif[l2]
2258 + r*interpolated_u[1]*dpsifdx(l2,1))*testf[l]*W;
2263 for(
unsigned k=0;k<2;k++)
2265 jacobian(local_eqn,local_unknown) +=
2266 scaled_re_st*r*mesh_velocity[k]*dpsifdx(l2,k)*testf[l]*
W;
2284 for(
unsigned l=0;l<n_pres;l++)
2291 residuals[local_eqn] -= r*source*testp[l]*
W;
2297 residuals[local_eqn] +=
2298 visc_ratio*viscosity*(interpolated_u[0] + r*interpolated_dudx(0,0)
2299 + r*interpolated_dudx(1,1))*testp[l]*W;
2303 residuals[local_eqn] +=
2304 (interpolated_u[0] + r*interpolated_dudx(0,0)
2305 + r*interpolated_dudx(1,1))*testp[l]*W;
2312 for(
unsigned l2=0;l2<n_node;l2++)
2316 if(local_unknown >= 0)
2320 jacobian(local_eqn,local_unknown) +=
2321 visc_ratio*viscosity*(psif[l2] + r*dpsifdx(l2,0))*testp[l]*W;
2325 jacobian(local_eqn,local_unknown) +=
2326 (psif[l2] + r*dpsifdx(l2,0))*testp[l]*W;
2332 if(local_unknown >= 0)
2336 jacobian(local_eqn,local_unknown) +=
2337 r*visc_ratio*viscosity*dpsifdx(l2,1)*testp[l]*
W;
2341 jacobian(local_eqn,local_unknown) +=
2342 r*dpsifdx(l2,1)*testp[l]*
W;
2369 "This has not been checked for generalised Newtonian elements!",
2370 OOMPH_CURRENT_FUNCTION,
2371 OOMPH_EXCEPTION_LOCATION);
2374 if(
ndof()==0) {
return; }
2377 const unsigned n_node =
nnode();
2386 unsigned u_nodal_index[3];
2391 Shape psif(n_node), testf(n_node);
2392 DShape dpsifdx(n_node,2), dtestfdx(n_node,2);
2395 Shape psip(n_pres), testp(n_pres);
2441 bool element_has_node_with_aux_node_update_fct=
false;
2442 for(
unsigned q=0;q<n_node;q++)
2450 element_has_node_with_aux_node_update_fct=
true;
2454 std::ostringstream warning_stream;
2455 warning_stream <<
"\nThe functionality to evaluate the additional" 2456 <<
"\ncontribution to the deriv of the residual eqn" 2457 <<
"\nw.r.t. the nodal coordinates which comes about" 2458 <<
"\nif a node's values are updated using an auxiliary" 2459 <<
"\nnode update function has NOT been tested for" 2460 <<
"\naxisymmetric Navier-Stokes elements. Use at your" 2464 warning_stream.str(),
2465 "GeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates",
2466 OOMPH_EXCEPTION_LOCATION);
2470 for(
unsigned i=0;
i<3;
i++)
2472 u_ref[
i]=*(nod_pt->
value_pt(u_nodal_index[
i]));
2476 for(
unsigned p=0;p<2;p++)
2479 double backup=nod_pt->
x(p);
2483 nod_pt->
x(p) += eps_fd;
2489 for(
unsigned i=0;
i<3;
i++)
2492 d_U_dX(p,q,
i)=(*(nod_pt->
value_pt(u_nodal_index[
i]))-u_ref[i])/eps_fd;
2496 nod_pt->
x(p)=backup;
2508 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
2518 ipt,psif,dpsifdx,d_dpsifdx_dX,testf,dtestfdx,d_dtestfdx_dX,dJ_dX);
2530 double interpolated_p=0.0;
2536 for(
unsigned l=0;l<n_pres;l++) { interpolated_p +=
p_axi_nst(l)*psip[l]; }
2542 for(
unsigned l=0;l<n_node;l++)
2545 const double psif_ = psif(l);
2548 for(
unsigned i=0;
i<2;
i++)
2554 for(
unsigned i=0;
i<3;
i++)
2558 interpolated_u[
i] += u_value*psif_;
2562 for(
unsigned j=0;j<2;j++)
2564 interpolated_dudx(i,j) += u_value*dpsifdx(l,j);
2573 for(
unsigned l=0;l<n_node;l++)
2576 for(
unsigned i=0;
i<2;
i++)
2584 for(
unsigned q=0;q<n_node;q++)
2587 for(
unsigned p=0;p<2;p++)
2590 for(
unsigned i=0;
i<3;
i++)
2593 for(
unsigned k=0;k<2;k++)
2598 for(
unsigned j=0;j<n_node;j++)
2603 d_dudx_dX(p,q,
i,k) = aux;
2611 const double pos_time_weight
2635 const double r = interpolated_x[0];
2645 for(
unsigned l=0;l<n_node;l++)
2648 const double testf_ = testf[l];
2659 for(
unsigned p=0;p<2;p++)
2662 for(
unsigned q=0;q<n_node;q++)
2669 double sum = r*body_force[0]*testf_;
2672 sum += r*scaled_re_inv_fr*testf_*G[0];
2675 sum += interpolated_p*(testf_ + r*dtestfdx(l,0));
2682 r*(1.0+
Gamma[0])*interpolated_dudx(0,0)*dtestfdx(l,0);
2684 sum -= visc_ratio*r*
2685 (interpolated_dudx(0,1) +
Gamma[0]*interpolated_dudx(1,0))*
2688 sum -= visc_ratio*(1.0 +
Gamma[0])*interpolated_u[0]*testf_/r;
2691 sum -= scaled_re_st*r*dudt[0]*testf_;
2695 scaled_re*(r*interpolated_u[0]*interpolated_dudx(0,0)
2696 - interpolated_u[2]*interpolated_u[2]
2697 + r*interpolated_u[1]*interpolated_dudx(0,1))*testf_;
2702 for(
unsigned k=0;k<2;k++)
2704 sum += scaled_re_st*r*mesh_velocity[k]
2705 *interpolated_dudx(0,k)*testf_;
2710 sum += 2.0*r*scaled_re_inv_ro*interpolated_u[2]*testf_;
2713 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*dJ_dX(p,q)*w;
2719 sum = r*d_body_force_dx(0,p)*psif[q]*testf_;
2720 if(p==0) { sum += body_force[0]*psif[q]*testf_; }
2723 if(p==0) { sum += scaled_re_inv_fr*G[0]*psif[q]*testf_; }
2726 sum += r*interpolated_p*d_dtestfdx_dX(p,q,l,0);
2727 if(p==0) { sum += interpolated_p*psif[q]*dtestfdx(l,0); }
2730 sum -= r*visc_ratio*(
2732 d_dudx_dX(p,q,0,0)*dtestfdx(l,0)
2733 + interpolated_dudx(0,0)*d_dtestfdx_dX(p,q,l,0))
2734 + (d_dudx_dX(p,q,0,1)
2735 +
Gamma[0]*d_dudx_dX(p,q,1,0))*dtestfdx(l,1)
2736 + (interpolated_dudx(0,1)
2737 +
Gamma[0]*interpolated_dudx(1,0))
2738 *d_dtestfdx_dX(p,q,l,1));
2743 interpolated_dudx(0,0)*psif[q]*dtestfdx(l,0)
2744 - interpolated_u[0]*psif[q]*testf_/(r*r))
2745 + (interpolated_dudx(0,1)
2746 +
Gamma[0]*interpolated_dudx(1,0))*psif[q]*dtestfdx(l,1));
2750 for(
unsigned k=0;k<2;k++)
2752 double tmp = scaled_re*interpolated_u[k];
2754 sum -= r*tmp*d_dudx_dX(p,q,0,k)*testf_;
2755 if(p==0) { sum -= tmp*interpolated_dudx(0,k)*psif[q]*testf_; }
2759 sum += scaled_re_st*r*pos_time_weight*interpolated_dudx(0,p)
2764 if(p==0) { sum -= scaled_re_st*dudt[0]*psif[q]*testf_; }
2769 sum += 2.0*scaled_re_inv_ro*interpolated_u[2]*psif[q]*testf_;
2773 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*J*w;
2777 if(element_has_node_with_aux_node_update_fct)
2780 double tmp = scaled_re_st*r*val_time_weight*psif[q]*testf_;
2781 tmp += r*scaled_re*interpolated_dudx(0,0)*psif[q]*testf_;
2782 for(
unsigned k=0;k<2;k++)
2784 double tmp2 = scaled_re*interpolated_u[k];
2786 tmp += r*tmp2*dpsifdx(q,k)*testf_;
2789 tmp += r*visc_ratio*(1.0+
Gamma[0])*dpsifdx(q,0)*dtestfdx(l,0);
2790 tmp += r*visc_ratio*dpsifdx(q,1)*dtestfdx(l,1);
2791 tmp += visc_ratio*(1.0+
Gamma[0])*psif[q]*testf_/r;
2794 sum = -d_U_dX(p,q,0)*tmp;
2797 tmp = scaled_re*r*interpolated_dudx(0,1)*psif[q]*testf_;
2798 tmp += r*visc_ratio*
Gamma[0]*dpsifdx(q,0)*dtestfdx(l,1);
2801 sum -= d_U_dX(p,q,1)*tmp;
2804 tmp = 2.0*(r*scaled_re_inv_ro
2805 + scaled_re*interpolated_u[2])*psif[q]*testf_;
2808 sum += d_U_dX(p,q,2)*tmp;
2811 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*J*w;
2826 for(
unsigned p=0;p<2;p++)
2829 for(
unsigned q=0;q<n_node;q++)
2836 double sum = r*body_force[1]*testf_;
2839 sum += r*scaled_re_inv_fr*testf_*G[1];
2842 sum += r*interpolated_p*dtestfdx(l,1);
2849 r*(interpolated_dudx(1,0) +
Gamma[1]*interpolated_dudx(0,1))
2852 sum -= visc_ratio*r*
2853 (1.0 +
Gamma[1])*interpolated_dudx(1,1)*dtestfdx(l,1);
2856 sum -= scaled_re_st*r*dudt[1]*testf_;
2860 scaled_re*(r*interpolated_u[0]*interpolated_dudx(1,0)
2861 + r*interpolated_u[1]*interpolated_dudx(1,1))*testf_;
2866 for(
unsigned k=0;k<2;k++)
2869 scaled_re_st*r*mesh_velocity[k]*interpolated_dudx(1,k)*testf_;
2874 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*dJ_dX(p,q)*w;
2880 sum = r*d_body_force_dx(1,p)*psif[q]*testf_;
2881 if(p==0) { sum += body_force[1]*psif[q]*testf_; }
2884 if(p==0) { sum += scaled_re_inv_fr*G[1]*psif[q]*testf_; }
2887 sum += r*interpolated_p*d_dtestfdx_dX(p,q,l,1);
2888 if(p==0) { sum += interpolated_p*psif[q]*dtestfdx(l,1); }
2891 sum -= r*visc_ratio*(
2892 (d_dudx_dX(p,q,1,0) +
Gamma[1]*d_dudx_dX(p,q,0,1))*dtestfdx(l,0)
2893 + (interpolated_dudx(1,0)
2894 +
Gamma[1]*interpolated_dudx(0,1))*d_dtestfdx_dX(p,q,l,0)
2895 + (1.0+
Gamma[1])*d_dudx_dX(p,q,1,1)*dtestfdx(l,1)
2896 + (1.0+
Gamma[1])*interpolated_dudx(1,1)*d_dtestfdx_dX(p,q,l,1));
2900 (interpolated_dudx(1,0)
2901 +
Gamma[1]*interpolated_dudx(0,1))*psif[q]*dtestfdx(l,0)
2902 + (1.0+
Gamma[1])*interpolated_dudx(1,1)*psif[q]*dtestfdx(l,1));
2906 for(
unsigned k=0;k<2;k++)
2908 double tmp = scaled_re*interpolated_u[k];
2910 sum -= r*tmp*d_dudx_dX(p,q,1,k)*testf_;
2911 if(p==0) { sum -= tmp*interpolated_dudx(1,k)*psif[q]*testf_; }
2915 sum += scaled_re_st*r*pos_time_weight*interpolated_dudx(1,p)
2920 if(p==0) { sum -= scaled_re_st*dudt[1]*psif[q]*testf_; }
2923 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*J*w;
2927 if(element_has_node_with_aux_node_update_fct)
2930 double tmp = scaled_re*r*interpolated_dudx(1,0)*psif[q]*testf_;
2931 tmp += r*visc_ratio*
Gamma[1]*dpsifdx(q,1)*dtestfdx(l,0);
2934 sum = -d_U_dX(p,q,0)*tmp;
2937 tmp = scaled_re_st*r*val_time_weight*psif[q]*testf_;
2938 tmp += r*scaled_re*interpolated_dudx(1,1)*psif[q]*testf_;
2939 for(
unsigned k=0;k<2;k++)
2941 double tmp2 = scaled_re*interpolated_u[k];
2943 tmp += r*tmp2*dpsifdx(q,k)*testf_;
2945 tmp += r*visc_ratio*(dpsifdx(q,0)*dtestfdx(l,0)
2946 + (1.0+
Gamma[1])*dpsifdx(q,1)*dtestfdx(l,1));
2949 sum -= d_U_dX(p,q,1)*tmp;
2952 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*J*w;
2967 for(
unsigned p=0;p<2;p++)
2970 for(
unsigned q=0;q<n_node;q++)
2977 double sum = r*body_force[2]*testf_;
2980 sum += r*scaled_re_inv_fr*testf_*G[2];
2988 sum -= visc_ratio*(r*interpolated_dudx(2,0) -
2989 Gamma[0]*interpolated_u[2])*dtestfdx(l,0);
2991 sum -= visc_ratio*r*interpolated_dudx(2,1)*dtestfdx(l,1);
2993 sum -= visc_ratio*((interpolated_u[2]/r)
2994 -
Gamma[0]*interpolated_dudx(2,0))*testf_;
2997 sum -= scaled_re_st*r*dudt[2]*testf_;
3001 scaled_re*(r*interpolated_u[0]*interpolated_dudx(2,0)
3002 + interpolated_u[0]*interpolated_u[2]
3003 + r*interpolated_u[1]*interpolated_dudx(2,1))*testf_;
3008 for(
unsigned k=0;k<2;k++)
3011 scaled_re_st*r*mesh_velocity[k]*interpolated_dudx(2,k)*testf_;
3016 sum -= 2.0*r*scaled_re_inv_ro*interpolated_u[0]*testf_;
3019 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*dJ_dX(p,q)*w;
3025 sum = r*d_body_force_dx(2,p)*psif[q]*testf_;
3026 if(p==0) { sum += body_force[2]*psif[q]*testf_; }
3029 if(p==0) { sum += scaled_re_inv_fr*G[2]*psif[q]*testf_; }
3034 sum -= visc_ratio*r*(
3035 d_dudx_dX(p,q,2,0)*dtestfdx(l,0)
3036 + interpolated_dudx(2,0)*d_dtestfdx_dX(p,q,l,0)
3037 + d_dudx_dX(p,q,2,1)*dtestfdx(l,1)
3038 + interpolated_dudx(2,1)*d_dtestfdx_dX(p,q,l,1));
3040 sum += visc_ratio*
Gamma[0]*d_dudx_dX(p,q,2,0)*testf_;
3044 sum -= visc_ratio*(interpolated_dudx(2,0)*psif[q]*dtestfdx(l,0)
3045 + interpolated_dudx(2,1)*psif[q]*dtestfdx(l,1)
3046 + interpolated_u[2]*psif[q]*testf_/(r*r));
3050 for(
unsigned k=0;k<2;k++)
3052 double tmp = scaled_re*interpolated_u[k];
3054 sum -= r*tmp*d_dudx_dX(p,q,2,k)*testf_;
3055 if(p==0) { sum -= tmp*interpolated_dudx(2,k)*psif[q]*testf_; }
3059 sum += scaled_re_st*r*pos_time_weight*interpolated_dudx(2,p)
3064 if(p==0) { sum -= scaled_re_st*dudt[2]*psif[q]*testf_; }
3069 sum -= 2.0*scaled_re_inv_ro*interpolated_u[0]*psif[q]*testf_;
3073 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*J*w;
3077 if(element_has_node_with_aux_node_update_fct)
3080 double tmp = (2.0*r*scaled_re_inv_ro
3081 + r*scaled_re*interpolated_dudx(2,0)
3082 - scaled_re*interpolated_u[2])*psif[q]*testf_;
3085 sum = -d_U_dX(p,q,0)*tmp;
3089 sum -= d_U_dX(p,q,1)*scaled_re*r*interpolated_dudx(2,1)
3093 tmp = scaled_re_st*r*val_time_weight*psif[q]*testf_;
3094 tmp -= scaled_re*interpolated_u[0]*psif[q]*testf_;
3095 for(
unsigned k=0;k<2;k++)
3097 double tmp2 = scaled_re*interpolated_u[k];
3099 tmp += r*tmp2*dpsifdx(q,k)*testf_;
3101 tmp += visc_ratio*(r*dpsifdx(q,0)
3102 -
Gamma[0]*psif[q])*dtestfdx(l,0);
3103 tmp += r*visc_ratio*dpsifdx(q,1)*dtestfdx(l,1);
3104 tmp += visc_ratio*((psif[q]/r) -
Gamma[0]*dpsifdx(q,0))*testf_;
3107 sum -= d_U_dX(p,q,2)*tmp;
3110 dresidual_dnodal_coordinates(local_eqn,p,q) += sum*J*w;
3124 for(
unsigned l=0;l<n_pres;l++)
3129 const double testp_ = testp[l];
3136 for(
unsigned p=0;p<2;p++)
3139 for(
unsigned q=0;q<n_node;q++)
3146 double aux = -r*source;
3149 aux += (interpolated_u[0]
3150 + r*interpolated_dudx(0,0)
3151 + r*interpolated_dudx(1,1));
3154 dresidual_dnodal_coordinates(local_eqn,p,q) +=
3155 aux*dJ_dX(p,q)*testp_*w;
3161 aux = -r*source_gradient[p]*psif[q];
3162 if(p==0) { aux -= source*psif[q]; }
3165 aux += r*(d_dudx_dX(p,q,0,0) + d_dudx_dX(p,q,1,1));
3168 aux += (interpolated_dudx(0,0) + interpolated_dudx(1,1))*psif[q];
3173 if(element_has_node_with_aux_node_update_fct)
3175 aux += d_U_dX(p,q,0)*(psif[q] + r*dpsifdx(q,0));
3176 aux += d_U_dX(p,q,1)*r*dpsifdx(q,1);
3180 dresidual_dnodal_coordinates(local_eqn,p,q) += aux*testp_*J*w;
3201 double*
const ¶meter_pt,
3208 if(parameter_pt!=this->
re_pt())
3210 std::ostringstream error_stream;
3212 "Cannot compute analytic jacobian for parameter addressed by " 3213 << parameter_pt <<
"\n";
3214 error_stream <<
"Can only compute derivatives wrt Re (" 3218 OOMPH_CURRENT_FUNCTION,
3219 OOMPH_EXCEPTION_LOCATION);
3223 bool diff_re =
false;
3224 bool diff_re_st =
false;
3225 bool diff_re_inv_fr =
false;
3226 bool diff_re_inv_ro =
false;
3229 if(parameter_pt==this->
re_pt()) {diff_re =
true;}
3230 if(parameter_pt==this->
re_st_pt()) {diff_re_st =
true;}
3231 if(parameter_pt==this->
re_invfr_pt()) {diff_re_inv_fr =
true;}
3232 if(parameter_pt==this->
re_invro_pt()) {diff_re_inv_ro =
true;}
3236 unsigned n_node =
nnode();
3242 unsigned u_nodal_index[3];
3247 Shape psif(n_node), testf(n_node);
3248 DShape dpsifdx(n_node,2), dtestfdx(n_node,2);
3251 Shape psip(n_pres), testp(n_pres);
3270 int local_eqn=0, local_unknown=0;
3273 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
3296 double interpolated_p=0.0;
3302 for(
unsigned l=0;l<n_pres;l++) {interpolated_p +=
p_axi_nst(l)*psip[l];}
3307 for(
unsigned l=0;l<n_node;l++)
3310 const double psif_ = psif(l);
3312 for(
unsigned i=0;
i<2;
i++)
3319 for(
unsigned i=0;
i<3;
i++)
3323 interpolated_u[
i] += u_value*psif_;
3326 for(
unsigned j=0;j<2;j++)
3327 {interpolated_dudx(i,j) += u_value*dpsifdx(l,j);}
3335 for(
unsigned l=0;l<n_node;l++)
3338 for(
unsigned i=0;
i<2;
i++)
3361 double r = interpolated_x[0];
3368 for(
unsigned l=0;l<n_node;l++)
3384 dres_dparam[local_eqn] += r*dens_ratio*testf[l]*G[0]*
W;
3409 dres_dparam[local_eqn] -= dens_ratio*r*dudt[0]*testf[l]*
W;
3415 dres_dparam[local_eqn] -=
3416 dens_ratio*(r*interpolated_u[0]*interpolated_dudx(0,0)
3417 - interpolated_u[2]*interpolated_u[2]
3418 + r*interpolated_u[1]*interpolated_dudx(0,1))*testf[l]*W;
3426 for(
unsigned k=0;k<2;k++)
3428 dres_dparam[local_eqn] +=
3429 dens_ratio*r*mesh_velocity[k]*interpolated_dudx(0,k)*testf[l]*
W;
3437 dres_dparam[local_eqn] +=
3438 2.0*r*dens_ratio*interpolated_u[2]*testf[l]*
W;
3445 for(
unsigned l2=0;l2<n_node;l2++)
3449 if(local_unknown >= 0)
3456 dmass_matrix_dparam(local_eqn,local_unknown) +=
3457 dens_ratio*r*psif[l2]*testf[l]*
W;
3476 djac_dparam(local_eqn,local_unknown)
3478 psif[l2]*testf[l]*
W;
3484 djac_dparam(local_eqn,local_unknown) -=
3485 dens_ratio*(r*psif[l2]*interpolated_dudx(0,0)
3486 + r*interpolated_u[0]*dpsifdx(l2,0)
3487 + r*interpolated_u[1]*dpsifdx(l2,1))*testf[l]*W;
3493 for(
unsigned k=0;k<2;k++)
3497 djac_dparam(local_eqn,local_unknown) +=
3498 dens_ratio*r*mesh_velocity[k]*dpsifdx(l2,k)*testf[l]*
W;
3506 if(local_unknown >= 0)
3514 djac_dparam(local_eqn,local_unknown) -=
3515 dens_ratio*r*psif[l2]*interpolated_dudx(0,1)*testf[l]*
W;
3521 if(local_unknown >= 0)
3526 djac_dparam(local_eqn,local_unknown) -=
3527 - dens_ratio*2.0*interpolated_u[2]*psif[l2]*testf[l]*
W;
3532 djac_dparam(local_eqn,local_unknown) +=
3533 2.0*r*dens_ratio*psif[l2]*testf[l]*
W;
3567 dres_dparam[local_eqn] += r*dens_ratio*testf[l]*G[1]*
W;
3588 dres_dparam[local_eqn] -= dens_ratio*r*dudt[1]*testf[l]*
W;
3594 dres_dparam[local_eqn] -=
3595 dens_ratio*(r*interpolated_u[0]*interpolated_dudx(1,0)
3596 + r*interpolated_u[1]*interpolated_dudx(1,1))*testf[l]*W;
3604 for(
unsigned k=0;k<2;k++)
3606 dres_dparam[local_eqn] +=
3607 dens_ratio*r*mesh_velocity[k]*interpolated_dudx(1,k)*testf[l]*
W;
3616 for(
unsigned l2=0;l2<n_node;l2++)
3620 if(local_unknown >= 0)
3632 djac_dparam(local_eqn,local_unknown) -=
3633 dens_ratio*r*psif[l2]*interpolated_dudx(1,0)*testf[l]*
W;
3639 if(local_unknown >= 0)
3646 dmass_matrix_dparam(local_eqn,local_unknown) +=
3647 dens_ratio*r*psif[l2]*testf[l]*
W;
3667 djac_dparam(local_eqn,local_unknown) -=
3669 psif[l2]*testf[l]*
W;
3675 djac_dparam(local_eqn,local_unknown) -=
3676 dens_ratio*(r*interpolated_u[0]*dpsifdx(l2,0)
3677 + r*psif[l2]*interpolated_dudx(1,1)
3678 + r*interpolated_u[1]*dpsifdx(l2,1))*testf[l]*W;
3684 for(
unsigned k=0;k<2;k++)
3688 djac_dparam(local_eqn,local_unknown) +=
3689 dens_ratio*r*mesh_velocity[k]*dpsifdx(l2,k)*testf[l]*
W;
3714 dres_dparam[local_eqn] += r*dens_ratio*testf[l]*G[2]*
W;
3738 dres_dparam[local_eqn] -= dens_ratio*r*dudt[2]*testf[l]*
W;
3744 dres_dparam[local_eqn] -=
3745 dens_ratio*(r*interpolated_u[0]*interpolated_dudx(2,0)
3746 + interpolated_u[0]*interpolated_u[2]
3747 + r*interpolated_u[1]*interpolated_dudx(2,1))*testf[l]*W;
3755 for(
unsigned k=0;k<2;k++)
3757 dres_dparam[local_eqn] +=
3758 dens_ratio*r*mesh_velocity[k]*interpolated_dudx(2,k)*testf[l]*
W;
3766 dres_dparam[local_eqn] -=
3767 2.0*r*dens_ratio*interpolated_u[0]*testf[l]*
W;
3774 for(
unsigned l2=0;l2<n_node;l2++)
3778 if(local_unknown >= 0)
3783 djac_dparam(local_eqn,local_unknown) -=
3784 dens_ratio*(r*psif[l2]*interpolated_dudx(2,0)
3785 + psif[l2]*interpolated_u[2])*testf[l]*W;
3791 djac_dparam(local_eqn,local_unknown) -=
3792 2.0*r*dens_ratio*psif[l2]*testf[l]*
W;
3798 if(local_unknown >= 0)
3803 djac_dparam(local_eqn,local_unknown) -=
3804 dens_ratio*r*psif[l2]*interpolated_dudx(2,1)*testf[l]*
W;
3810 if(local_unknown >= 0)
3817 dmass_matrix_dparam(local_eqn,local_unknown) +=
3818 dens_ratio*r*psif[l2]*testf[l]*
W;
3841 djac_dparam(local_eqn,local_unknown) -=
3843 psif[l2]*testf[l]*
W;
3849 djac_dparam(local_eqn,local_unknown) -=
3850 dens_ratio*(r*interpolated_u[0]*dpsifdx(l2,0)
3851 + interpolated_u[0]*psif[l2]
3852 + r*interpolated_u[1]*dpsifdx(l2,1))*testf[l]*W;
3860 for(
unsigned k=0;k<2;k++)
3862 djac_dparam(local_eqn,local_unknown) +=
3863 dens_ratio*r*mesh_velocity[k]*dpsifdx(l2,k)*testf[l]*
W;
3895 unsigned n_node =
nnode();
3898 unsigned u_nodal_index[3];
3903 Shape psif(n_node), testf(n_node);
3904 DShape dpsifdx(n_node,2), dtestfdx(n_node,2);
3919 int local_eqn=0, local_unknown=0, local_freedom=0;
3922 const unsigned n_dof = this->
ndof();
3928 for(
unsigned ipt=0;ipt<Nintpt;ipt++)
3955 for(
unsigned l=0;l<n_node;l++)
3958 const double psif_ = psif(l);
3960 for(
unsigned i=0;
i<2;
i++)
3966 for(
unsigned i=0;
i<3;
i++)
3970 interpolated_u[
i] += u_value*psif_;
3973 for(
unsigned j=0;j<2;j++)
3974 {interpolated_dudx(i,j) += u_value*dpsifdx(l,j);}
3982 OOMPH_CURRENT_FUNCTION,
3983 OOMPH_EXCEPTION_LOCATION);
3987 double r = interpolated_x[0];
3994 for(
unsigned l=0;l<n_node;l++)
4003 for(
unsigned l3=0;l3<n_node;l3++)
4007 if(local_freedom >= 0)
4013 for(
unsigned l2=0;l2<n_node;l2++)
4017 if(local_unknown >= 0)
4020 temp -=scaled_re*(r*psif[l2]*dpsifdx(l3,0)
4021 + r*psif[l3]*dpsifdx(l2,0))*
4022 Y[local_unknown]*testf[l]*W;
4027 if(local_unknown >= 0)
4031 scaled_re*r*psif[l2]*dpsifdx(l3,1)*Y[local_unknown]*testf[l]*
W;
4035 jac_y(local_eqn,local_freedom) += temp;
4041 if(local_freedom >= 0)
4046 for(
unsigned l2=0;l2<n_node;l2++)
4050 if(local_unknown >= 0)
4053 temp -= scaled_re*(r*psif[l3]*dpsifdx(l2,1))*
4054 Y[local_unknown]*testf[l]*W;
4058 jac_y(local_eqn,local_freedom) += temp;
4063 if(local_freedom >= 0)
4068 for(
unsigned l2=0;l2<n_node;l2++)
4072 if(local_unknown >= 0)
4076 - scaled_re*2.0*psif[l3]*psif[l2]*Y[local_unknown]*testf[l]*
W;
4080 jac_y(local_eqn,local_freedom) += temp;
4093 for(
unsigned l3=0;l3<n_node;l3++)
4097 if(local_freedom >= 0)
4102 for(
unsigned l2=0;l2<n_node;l2++)
4106 if(local_unknown >= 0)
4110 scaled_re*(r*psif[l3]*dpsifdx(l2,0))*
4111 Y[local_unknown]*testf[l]*W;
4114 jac_y(local_eqn,local_freedom) += temp;
4122 if(local_freedom >= 0)
4127 for(
unsigned l2=0;l2<n_node;l2++)
4131 if(local_unknown >= 0)
4135 scaled_re*r*psif[l2]*dpsifdx(l3,0)*Y[local_unknown]*testf[l]*
W;
4140 if(local_unknown >= 0)
4145 r*psif[l2]*dpsifdx(l3,1)
4146 + r*psif[l3]*dpsifdx(l2,1))*Y[local_unknown]*testf[l]*W;
4153 jac_y(local_eqn,local_freedom) += temp;
4164 for(
unsigned l3=0;l3<n_node;l3++)
4168 if(local_freedom >= 0)
4173 for(
unsigned l2=0;l2<n_node;l2++)
4177 if(local_unknown >= 0)
4181 scaled_re*(r*psif[l3]*dpsifdx(l2,0)
4182 + psif[l3]*psif[l2])*Y[local_unknown]*testf[l]*W;
4186 jac_y(local_eqn,local_freedom) += temp;
4191 if(local_freedom >= 0)
4196 for(
unsigned l2=0;l2<n_node;l2++)
4200 if(local_unknown >= 0)
4204 scaled_re*(r*psif[l3]*dpsifdx(l2,1))*
4205 Y[local_unknown]*testf[l]*W;
4209 jac_y(local_eqn,local_freedom) += temp;
4215 if(local_freedom >= 0)
4221 for(
unsigned l2=0;l2<n_node;l2++)
4225 if(local_unknown >= 0)
4229 scaled_re*(r*psif[l2]*dpsifdx(l3,0)
4230 + psif[l2]*psif[l3])*Y[local_unknown]*testf[l]*W;
4235 if(local_unknown >= 0)
4239 scaled_re*r*psif[l2]*dpsifdx(l3,1)*Y[local_unknown]*testf[l]*
W;
4243 jac_y(local_eqn,local_freedom) += temp;
4255 const unsigned n_vec = C.
nrow();
4256 for(
unsigned i=0;
i<n_dof;
i++)
4258 for(
unsigned k=0;k<n_dof;k++)
4261 const double j_y = jac_y(
i,k);
4263 for(
unsigned v=0;v<n_vec;v++)
4265 product(v,
i) += j_y*C(v,k);
4286 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 4289 unsigned n_node = this->
nnode();
4295 std::pair<unsigned,unsigned> dof_lookup;
4298 unsigned pressure_dof_number = 3;
4301 for (
unsigned n = 0; n < n_press; n++)
4309 if (local_eqn_number >= 0)
4313 dof_lookup.first = this->
eqn_number(local_eqn_number);
4314 dof_lookup.second = pressure_dof_number;
4317 dof_lookup_list.push_front(dof_lookup);
4322 for (
unsigned n = 0; n < n_node; n++)
4328 for (
unsigned v = 0; v < nv; v++)
4334 if (local_eqn_number >= 0)
4338 dof_lookup.first = this->
eqn_number(local_eqn_number);
4339 dof_lookup.second = v;
4342 dof_lookup_list.push_front(dof_lookup);
4389 std::list<std::pair<
unsigned long,
4390 unsigned> >& dof_lookup_list)
const 4393 unsigned n_node = this->
nnode();
4396 std::pair<unsigned,unsigned> dof_lookup;
4399 for (
unsigned n = 0; n < n_node; n++)
4405 for (
unsigned v = 0; v < nv; v++)
4413 if (local_eqn_number >= 0)
4417 dof_lookup.first = this->
eqn_number(local_eqn_number);
4420 dof_lookup.second = v;
4423 dof_lookup_list.push_front(dof_lookup);
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
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 *& re_invfr_pt()
Pointer to global inverse Froude number.
unsigned long nrow() const
Return the number of rows of the matrix.
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector.
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...
unsigned long ncol() const
Return the number of columns of the matrix.
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 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 fl...
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 ...
GeneralisedNewtonianConstitutiveEquation< 3 > * Constitutive_eqn_pt
Pointer to the generalised Newtonian constitutive equation.
virtual double dviscosity_dinvariant(const double &second_invariant_of_rate_of_strain_tensor)=0
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...
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
void perform_auxiliary_node_update_fct()
Execute auxiliary update function (if any) – this can be used to update any nodal values following t...
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...
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates. This function computes these terms analytically and overwrites the default implementation in the FiniteElement base class. dresidual_dnodal_coordinates(l,i,j) = d res(l) / dX_{ij}.
double *& re_pt()
Pointer to Reynolds number.
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...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
const double & re() const
Reynolds number.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
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...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
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 global Reynolds number.
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
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.
bool has_auxiliary_node_update_fct_pt()
Boolean to indicate if node has a pointer to and auxiliary update function.
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...
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
unsigned ndof() const
Return the number of equations/dofs in the element.
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
double & x(const unsigned &i)
Return the i-th nodal coordinate.
double dissipation() const
Return integral of dissipation over element.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
static bool Pre_multiply_by_viscosity_ratio
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 unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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. Plot at a given number of plot points and compute L2 error and L2 norm of velocity solution over element.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
double & dt(const unsigned &t=0)
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"...
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
double get_source_fct(const double &time, const unsigned &ipt, const Vector< double > &x)
Calculate the source fct at given time and Eulerian position.
double interpolated_p_axi_nst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
virtual void get_source_fct_gradient(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &gradient)
double pressure_integral() const
Integral of pressure over element.
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 strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: where (in that order)
double & time()
Return the current value of the continuous time.
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...
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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...
double *& re_st_pt()
Pointer to product of Reynolds and Strouhal number (=Womersley number)
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
void output(std::ostream &outfile)
Output function: x,y,[z],u,v,[w],p in tecplot format. Default number of plot points.
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 void pshape_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
const double & re_invro() const
Global Reynolds number multiplied by inverse Rossby number.
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.
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...
bool Use_extrapolated_strainrate_to_compute_second_invariant
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.
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. NOTE: Moved to cc file because of a possible compiler bug in gcc (yes, really!). The move to the cc file avoids inlining which appears to cause problems (only) when compiled with gcc and -O3; offensive "illegal read" is in optimised-out section of code and data that is allegedly illegal is readily readable (by other means) just before this function is called so I can't really see how we could possibly be responsible for this...
virtual unsigned u_index_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component.
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...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers...
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed...
Time *const & time_pt() const
Access function for the pointer to time (const version)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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...
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.
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...
virtual unsigned npres_axi_nst() const =0
Function to return number of pressure degrees of freedom.
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. Function prints as many components as are returned in solution Vector.
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 double viscosity(const double &second_invariant_of_rate_of_strain_tensor)=0
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...
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number...
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
double *& re_invro_pt()
Pointer to global inverse Froude number.
double second_invariant(const DenseMatrix< double > &tensor)
Compute second invariant of tensor.
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
const double & re_invfr() const
Global inverse Froude number.
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
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...
const double & density_ratio() const
Density ratio for element: Element's density relative to the viscosity used in the definition of the ...
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
const Vector< double > & g() const
Vector of gravitational components.
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...