31 #include "libmesh/mesh.h" 32 #include "libmesh/fe_interface.h" 33 #include "libmesh/quadrature.h" 34 #include "libmesh/string_to_enum.h" 35 #include "libmesh/parameters.h" 41 _if_viscous(f.gas_property.if_viscous),
42 _include_pressure_switch(false),
45 _dissipation_scaling(1.) {
109 std::vector<MAST::FEMOperatorMatrix>& dB_mat) {
111 conservative_sol.setZero();
114 const std::vector<std::vector<Real> >& phi = fe.
get_phi();
115 const unsigned int n_phi = (
unsigned int)phi.size();
118 phi_vals = RealVectorX::Zero(n_phi);
120 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
121 phi_vals(i_nd) = phi[i_nd][qp];
125 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi =
129 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++ )
131 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
132 phi_vals(i_nd) = dphi[i_nd][qp](i_dim);
133 dB_mat[i_dim].reinit(dim+2, phi_vals);
136 B_mat.
vector_mult( conservative_sol, elem_solution );
138 primitive_sol.
zero();
139 primitive_sol.
init(dim,
154 const unsigned int n1 = 2 +
dim;
166 switch (calculate_dim)
171 flux(n1-1) = u1 * (rho * e_tot + p);
175 flux(3) = rho * u1 * u3;
177 flux(2) = rho * u1 * u2;
179 flux(1) = rho * u1 * u1 + p;
187 flux(n1-1) = u2 * (rho * e_tot + p);
191 flux(3) = rho * u2 * u3;
193 flux(2) = rho * u2 * u2 + p;
195 flux(1) = rho * u2 * u1;
203 flux(n1-1) = u3 * (rho * e_tot + p);
207 flux(3) = rho * u3 * u3 + p;
209 flux(2) = rho * u3 * u2;
211 flux(1) = rho * u3 * u1;
228 const unsigned int n1 = 2 +
dim;
231 uvec = RealVectorX::Zero(3);
240 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++) {
242 flux(1+i_dim) += stress_tensor(calculate_dim, i_dim);
244 flux(n1-1) += uvec(i_dim) * stress_tensor(calculate_dim, i_dim);
247 flux(n1-1) += sol.
k_thermal * temp_gradient(calculate_dim);
256 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
262 const unsigned int n1 =
dim+2;
265 dprim_dx = RealVectorX::Zero(n1),
266 dcons_dx = RealVectorX::Zero(n1);
268 stress_tensor.setZero();
269 temp_gradient.setZero();
271 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++) {
273 dB_mat[i_dim].vector_mult(dcons_dx, elem_sol);
274 dprim_dx = dprim_dcons * dcons_dx;
276 for (
unsigned int j_dim=0; j_dim<
dim; j_dim++) {
278 stress_tensor(i_dim, j_dim) += psol.
mu * dprim_dx(j_dim+1);
279 stress_tensor(j_dim, i_dim) += psol.
mu * dprim_dx(j_dim+1);
281 stress_tensor(j_dim, j_dim) += psol.
lambda * dprim_dx(i_dim+1);
284 temp_gradient(i_dim) = dprim_dx(n1-1);
294 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
301 const unsigned int n1 =
dim+2;
304 dprim_dx = RealVectorX::Zero(n1),
305 dcons_dx = RealVectorX::Zero(n1),
306 dprim_sens_dx = RealVectorX::Zero(n1),
307 dcons_sens_dx = RealVectorX::Zero(n1);
309 stress_tensor_sens.setZero();
310 temp_gradient_sens.setZero();
312 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++) {
314 dB_mat[i_dim].vector_mult(dcons_dx, elem_sol);
315 dprim_dx = dprim_dcons * dcons_dx;
317 dB_mat[i_dim].vector_mult(dcons_sens_dx, elem_sol_sens);
318 dprim_sens_dx = dprim_dcons * dcons_sens_dx;
320 for (
unsigned int j_dim=0; j_dim<
dim; j_dim++) {
322 stress_tensor_sens(i_dim, j_dim) += (dsol.
dmu * dprim_dx(j_dim+1) +
323 psol.
mu * dprim_sens_dx(j_dim+1));
324 stress_tensor_sens(j_dim, i_dim) += (dsol.
dmu * dprim_dx(j_dim+1) +
325 psol.
mu * dprim_sens_dx(j_dim+1));
327 stress_tensor_sens(j_dim, j_dim) += (dsol.
dlambda * dprim_dx(i_dim+1) +
328 psol.
lambda * dprim_sens_dx(i_dim+1));
331 temp_gradient_sens(i_dim) = dprim_sens_dx(n1-1);
347 const unsigned int n1 = 2 +
dim;
349 dcons_dprim.setZero();
350 dprim_dcons.setZero();
364 dcons_dprim(3, 0) = u3;
365 dcons_dprim(3, 3) = rho;
367 dcons_dprim(n1-1, 3) = rho*u3;
372 dcons_dprim(2, 0) = u2;
373 dcons_dprim(2, 2) = rho;
375 dcons_dprim(n1-1, 2) = rho*u2;
380 dcons_dprim(0, 0) = 1.;
382 dcons_dprim(1, 0) = u1;
383 dcons_dprim(1, 1) = rho;
385 dcons_dprim(n1-1, 0) = e_tot;
386 dcons_dprim(n1-1, 1) = rho*u1;
387 dcons_dprim(n1-1, n1-1) = rho*cv;
395 dprim_dcons(3, 0) = -u3/rho;
396 dprim_dcons(3, 3) = 1./rho;
398 dprim_dcons(n1-1, 3) = -u3/cv/rho;
403 dprim_dcons(2, 0) = -u2/rho;
404 dprim_dcons(2, 2) = 1./rho;
406 dprim_dcons(n1-1, 2) = -u2/cv/rho;
411 dprim_dcons(0, 0) = 1.;
413 dprim_dcons(1, 0) = -u1/rho;
414 dprim_dcons(1, 1) = 1./rho;
416 dprim_dcons(n1-1, 0) = (-e_tot+2*k)/cv/rho;
417 dprim_dcons(n1-1, 1) = -u1/cv/rho;
418 dprim_dcons(n1-1, n1-1) = 1./cv/rho;
435 const unsigned int n1 = 2 +
dim;
449 switch (calculate_dim)
457 mat(1, 3) = -u3*R/cv;
463 mat(n1-1, 3) = -u1*u3*R/cv;
468 mat(1, 2) = -u2*R/cv;
474 mat(n1-1, 2) = -u1*u2*R/cv;
481 mat(1, 0) = -u1*u1+R*k/cv;
482 mat(1, 1) = u1*(2.0-R/cv);
485 mat(n1-1, 0) = u1*(R*(-e_tot+2.0*k)-e_tot*cv)/cv;
486 mat(n1-1, 1) = e_tot+R*(T-u1*u1/cv);
487 mat(n1-1, n1-1) = u1*gamma;
500 mat(2, 3) = -u3*R/cv;
506 mat(n1-1, 3) = -u2*u3*R/cv;
517 mat(2, 0) = -u2*u2+R*k/cv;
518 mat(2, 1) = -u1*R/cv;
519 mat(2, 2) = u2*(2.0-R/cv);
522 mat(n1-1, 0) = u2*(R*(-e_tot+2.0*k)-e_tot*cv)/cv;
523 mat(n1-1, 1) = -u1*u2*R/cv;
524 mat(n1-1, 2) = e_tot+R*(T-u2*u2/cv);
525 mat(n1-1, n1-1) = u2*gamma;
531 libmesh_assert_msg(
false,
"invalid dim");
549 mat(3, 0) = -u3*u3+R*k/cv;
550 mat(3, 1) = -u1*R/cv;
551 mat(3, 2) = -u2*R/cv;
552 mat(3, 3) = u3*(2.0-R/cv);
555 mat(n1-1, 0) = u3*(R*(-e_tot+2.0*k)-e_tot*cv)/cv;
556 mat(n1-1, 1) = -u1*u3*R/cv;
557 mat(n1-1, 2) = -u2*u3*R/cv;
558 mat(n1-1, 3) = e_tot+R*(T-u3*u3/cv);
559 mat(n1-1, n1-1) = u3*gamma;
564 libmesh_assert_msg(
false,
"invalid dim");
576 const unsigned int deriv_dim,
582 const unsigned int n1 = 2 +
dim;
588 u2 =
dim>1?uvec(1):0.,
589 u3 =
dim>2?uvec(2):0.,
620 mat(1,1) = (lambda+2.*mu);
622 mat(n1-1,1) = u1*(lambda+2.*mu);
623 mat(n1-1,n1-1) = kth;
636 mat(n1-1,2) = u1*lambda;
647 mat(n1-1,3) = u1*lambda;
664 mat(n1-1,1) = u2*lambda;
685 mat(2,2) = (lambda+2.*mu);
688 mat(n1-1,2) = u2*(lambda+2.*mu);
689 mat(n1-1,n1-1) = kth;
702 mat(n1-1,3) = u2*lambda;
719 mat(n1-1,1) = u3*lambda;
730 mat(n1-1,2) = u3*lambda;
741 mat(3,3) = (lambda+2.*mu);
745 mat(n1-1,3) = u3*(lambda+2.*mu);
746 mat(n1-1,n1-1) = kth;
760 const unsigned int deriv_dim,
764 const unsigned int n1 = 2 +
dim;
791 mat(3,0) = -u3*mu/rho;
794 mat(n1-1,3) = u3*(-kth+cv*mu)/cv/rho;
799 mat(2,0) = -u2*mu/rho;
802 mat(n1-1,2) = u2*(-kth+cv*mu)/cv/rho;
807 mat(1,0) = -u1*(lambda+2.*mu)/rho;
808 mat(1,1) = (lambda+2.*mu)/rho;
810 mat(n1-1,0) = (kth*(2.*k-e_tot)-cv*(2.*k*mu+u1*u1*(mu+lambda)))/cv/rho;
811 mat(n1-1,1) = u1*(-kth+cv*(lambda+2.*mu))/cv/rho;
812 mat(n1-1,n1-1) = kth/cv/rho;
820 mat(1,0) = -u2*lambda/rho;
821 mat(1,2) = lambda/rho;
823 mat(2,0) = -u1*mu/rho;
826 mat(n1-1,0) = -u1*u2*(lambda+mu)/rho;
827 mat(n1-1,1) = u2*mu/rho;
828 mat(n1-1,2) = u1*lambda/rho;
834 mat(1,0) = -u3*lambda/rho;
835 mat(1,3) = lambda/rho;
837 mat(3,0) = -u1*mu/rho;
840 mat(n1-1,0) = -u1*u3*(lambda+mu)/rho;
841 mat(n1-1,1) = u3*mu/rho;
842 mat(n1-1,3) = u1*lambda/rho;
855 mat(1,0) = -u2*mu/rho;
858 mat(2,0) = -u1*lambda/rho;
859 mat(2,1) = lambda/rho;
861 mat(n1-1,0) = -u1*u2*(lambda+mu)/rho;
862 mat(n1-1,1) = u2*lambda/rho;
863 mat(n1-1,2) = u1*mu/rho;
873 mat(3,0) = -u3*mu/rho;
876 mat(n1-1,3) = u3*(-kth+cv*mu)/cv/rho;
882 mat(1,0) = -u1*mu/rho;
885 mat(2,0) = -u2*(lambda+2.*mu)/rho;
886 mat(2,2) = (lambda+2.*mu)/rho;
888 mat(n1-1,0) = (kth*(2.*k-e_tot)-cv*(2.*k*mu+u2*u2*(mu+lambda)))/cv/rho;
889 mat(n1-1,1) = u1*(-kth+cv*mu)/cv/rho;
890 mat(n1-1,2) = u2*(-kth+cv*(lambda+2.*mu))/cv/rho;
891 mat(n1-1,n1-1) = kth/cv/rho;
899 mat(2,0) = -u3*lambda/rho;
900 mat(2,3) = lambda/rho;
902 mat(3,0) = -u2*mu/rho;
905 mat(n1-1,0) = -u2*u3*(lambda+mu)/rho;
906 mat(n1-1,2) = u3*mu/rho;
907 mat(n1-1,3) = u2*lambda/rho;
920 mat(1,0) = -u3*mu/rho;
923 mat(3,0) = -u1*lambda/rho;
924 mat(3,1) = lambda/rho;
926 mat(n1-1,0) = -u1*u3*(lambda+mu)/rho;
927 mat(n1-1,1) = u3*lambda/rho;
928 mat(n1-1,3) = u1*mu/rho;
934 mat(2,0) = -u3*mu/rho;
937 mat(3,0) = -u2*lambda/rho;
938 mat(3,2) = lambda/rho;
940 mat(n1-1,0) = -u2*u3*(lambda+mu)/rho;
941 mat(n1-1,2) = u3*lambda/rho;
942 mat(n1-1,3) = u2*mu/rho;
948 mat(1,0) = -u1*mu/rho;
951 mat(2,0) = -u2*mu/rho;
954 mat(3,0) = -u3*(lambda+2.*mu)/rho;
955 mat(3,3) = (lambda+2.*mu)/rho;
957 mat(n1-1,0) = (kth*(2.*k-e_tot)-cv*(2.*k*mu+u3*u3*(mu+lambda)))/cv/rho;
958 mat(n1-1,1) = u1*(-kth+cv*mu)/cv/rho;
959 mat(n1-1,2) = u2*(-kth+cv*mu)/cv/rho;
960 mat(n1-1,3) = u3*(-kth+cv*(lambda+2.*mu))/cv/rho;
961 mat(n1-1,n1-1) = kth/cv/rho;
976 (
const unsigned int calculate_dim,
978 std::vector<RealMatrixX >& jac) {
980 const unsigned int n1 = 2 +
dim;
983 dprim_dcons = RealMatrixX::Zero(n1, n1),
984 mat = RealMatrixX::Zero(n1, n1);
986 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
987 jac[i_cvar].setZero();
992 for (
unsigned int i_pvar=0; i_pvar<n1; i_pvar++)
995 (calculate_dim, i_pvar, sol, mat);
996 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
998 if (fabs(dprim_dcons(i_pvar, i_cvar)) > 0.0)
999 jac[i_cvar] += dprim_dcons(i_pvar, i_cvar) * mat;
1009 (
const unsigned int calculate_dim,
1010 const unsigned int primitive_var,
1016 const unsigned int n1 = 2 +
dim;
1028 switch (calculate_dim)
1049 mat(n1-1, 3) = -u3*R/cv;
1057 mat(n1-1, 2) = -u2*R/cv;
1062 mat(1, 0) = -u1*(2.0-R/cv);
1063 mat(1, 1) = (2.0-R/cv);
1065 mat(n1-1, 0) = (-e_tot*(cv+R)+2.0*R*k + u1*u1*(-cv+R))/cv;
1066 mat(n1-1, 1) = u1*(1.0-2.0*R/cv);
1067 mat(n1-1, n1-1) = (cv+R)/cv;
1076 mat(1, 0) = u2*R/cv;
1082 mat(n1-1, 0) = (-cv+R)*u1*u2/cv;
1084 mat(n1-1, 2) = -u1*R/cv;
1090 mat(1, 0) = u3*R/cv;
1096 mat(n1-1, 0) = (-cv+R)*u1*u3/cv;
1098 mat(n1-1, 3) = -u1*R/cv;
1105 mat(n1-1, 0) = -u1*(cv+R);
1106 mat(n1-1, 1) = cv+R;
1111 libmesh_assert_msg(
false,
"Invalid primitive variable number");
1132 mat(2, 0) = u1*R/cv;
1136 mat(n1-1, 0) = (-cv+R)*u1*u2/cv;
1137 mat(n1-1, 1) = -u2*R/cv;
1151 mat(n1-1, 3) = -u3*R/cv;
1160 mat(2, 0) = -u2*(2.0-R/cv);
1161 mat(2, 2) = (2.0-R/cv);
1163 mat(n1-1, 0) = (-e_tot*(cv+R)+2.0*R*k + u2*u2*(-cv+R))/cv;
1164 mat(n1-1, 1) = -u1*R/cv;
1165 mat(n1-1, 2) = u2*(1.0-2.0*R/cv);
1166 mat(n1-1, n1-1) = (cv+R)/cv;
1175 mat(2, 0) = u3*R/cv;
1181 mat(n1-1, 0) = (-cv+R)*u2*u3/cv;
1183 mat(n1-1, 3) = -u2*R/cv;
1190 mat(n1-1, 0) = -u2*(cv+R);
1191 mat(n1-1, 2) = cv+R;
1196 libmesh_assert_msg(
false,
"Invalid primitive variable number");
1217 mat(3, 0) = u1*R/cv;
1220 mat(n1-1, 0) = (-cv+R)*u1*u3/cv;
1221 mat(n1-1, 1) = -u3*R/cv;
1231 mat(3, 0) = u2*R/cv;
1234 mat(n1-1, 0) = (-cv+R)*u2*u3/cv;
1235 mat(n1-1, 2) = -u3*R/cv;
1248 mat(3, 0) = -u3*(2.0-R/cv);
1249 mat(3, 3) = (2.0-R/cv);
1251 mat(n1-1, 0) = (-e_tot*(cv+R)+2.0*R*k + u3*u3*(-cv+R))/cv;
1252 mat(n1-1, 1) = -u1*R/cv;
1253 mat(n1-1, 2) = -u2*R/cv;
1254 mat(n1-1, 3) = u3*(1.0-2.0*R/cv);
1255 mat(n1-1, n1-1) = (cv+R)/cv;
1262 mat(n1-1, 0) = -u3*(cv+R);
1263 mat(n1-1, 3) = cv+R;
1268 libmesh_assert_msg(
false,
"Invalid primitive variable number");
1275 libmesh_assert_msg(
false,
"invalid dim");
1286 const libMesh::Point& normal,
1292 const unsigned int n1 = 2 +
dim;
1294 eig_vals.setZero(); l_eig_mat.setZero(); l_eig_mat_inv_tr.setZero();
1296 Real nx=0., ny=0., nz=0., u=0.;
1297 unsigned int dim_for_eig_vec=100;
1331 if ((fabs(nx)>=fabs(ny)) && (fabs(nx)>=fabs(nz)))
1332 dim_for_eig_vec = 1;
1333 else if ((fabs(ny)>=fabs(nx)) && (fabs(ny)>=fabs(nz)))
1334 dim_for_eig_vec = 2;
1335 else if ((fabs(nz)>=fabs(nx)) && (fabs(nz)>=fabs(ny)))
1336 dim_for_eig_vec = 3;
1348 eig_vals(n1-2) = u-a;
1349 eig_vals(n1-1) = u+a;
1360 l_eig_mat(3, n1-2) = -u3-nz*a/(gamma-1.0);
1363 l_eig_mat(3, n1-1) = -u3+nz*a/(gamma-1.0);
1366 l_eig_mat_inv_tr(3, 0) = (gamma-1.0)*u1*u3/(a*a)-nx*nz;
1369 l_eig_mat_inv_tr(3, 1) = (gamma-1.0)*u2*u3/(a*a)-ny*nz;
1372 l_eig_mat_inv_tr(0, 2) = (gamma-1.0)*u3/(a*a);
1373 l_eig_mat_inv_tr(1, 2) = (gamma-1.0)*u3*u1/(a*a)-nz*nx;
1374 l_eig_mat_inv_tr(2, 2) = (gamma-1.0)*u3*u2/(a*a)-nz*ny;
1375 l_eig_mat_inv_tr(3, 2) = (gamma-1.0)*u3*u3/(a*a)+1.0-nz*nz;
1376 l_eig_mat_inv_tr(n1-1, 2) = (gamma-1.0)*k*u3/(a*a)+u3-nz*u;
1379 l_eig_mat_inv_tr(3, dim_for_eig_vec-1) = u3;
1382 l_eig_mat_inv_tr(3, n1-2) = 0.5*(gamma-1.0)*(-nz+u3/a)/a;
1385 l_eig_mat_inv_tr(3, n1-1) = 0.5*(gamma-1.0)*(nz+u3/a)/a;
1392 l_eig_mat(2, n1-2) = -u2-ny*a/(gamma-1.0);
1395 l_eig_mat(2, n1-1) = -u2+ny*a/(gamma-1.0);
1398 l_eig_mat_inv_tr(2, 0) = (gamma-1.0)*u1*u2/(a*a)-nx*ny;
1401 l_eig_mat_inv_tr(0, 1) = (gamma-1.0)*u2/(a*a);
1402 l_eig_mat_inv_tr(1, 1) = (gamma-1.0)*u2*u1/(a*a)-ny*nx;
1403 l_eig_mat_inv_tr(2, 1) = (gamma-1.0)*u2*u2/(a*a)+1.0-ny*ny;
1404 l_eig_mat_inv_tr(n1-1, 1) = (gamma-1.0)*k*u2/(a*a)+u2-ny*u;
1407 l_eig_mat_inv_tr(2, dim_for_eig_vec-1) = u2;
1410 l_eig_mat_inv_tr(2, n1-2) = 0.5*(gamma-1.0)*(-ny+u2/a)/a;
1413 l_eig_mat_inv_tr(2, n1-1) = 0.5*(gamma-1.0)*(ny+u2/a)/a;
1419 l_eig_mat(0, n1-2) = k+u*a/(gamma-1.0);
1420 l_eig_mat(1, n1-2) = -u1-nx*a/(gamma-1.0);
1421 l_eig_mat(n1-1, n1-2) = 1.0;
1424 l_eig_mat(0, n1-1) = k-u*a/(gamma-1.0);
1425 l_eig_mat(1, n1-1) = -u1+nx*a/(gamma-1.0);
1426 l_eig_mat(n1-1, n1-1) = 1.0;
1429 l_eig_mat_inv_tr(0, 0) = (gamma-1.0)*u1/(a*a);
1430 l_eig_mat_inv_tr(1, 0) = (gamma-1.0)*u1*u1/(a*a)+1.0-nx*nx;
1431 l_eig_mat_inv_tr(n1-1, 0) = (gamma-1.0)*k*u1/(a*a)+u1-nx*u;
1434 l_eig_mat_inv_tr(0, dim_for_eig_vec-1) = 1.0;
1435 l_eig_mat_inv_tr(1, dim_for_eig_vec-1) = u1;
1436 l_eig_mat_inv_tr(n1-1, dim_for_eig_vec-1) = k;
1437 l_eig_mat_inv_tr.col(dim_for_eig_vec-1) *= -1.0/(cv*T*gamma);
1440 l_eig_mat_inv_tr(0, n1-2) = 1.0/(2.0*cv*T*gamma);
1441 l_eig_mat_inv_tr(1, n1-2) = 0.5*(gamma-1.0)*(-nx+u1/a)/a;
1442 l_eig_mat_inv_tr(n1-1, n1-2) = 0.5*(1.0+(gamma-1.0)*(-u+k/a)/a);
1445 l_eig_mat_inv_tr(0, n1-1) = 1.0/(2.0*cv*T*gamma);
1446 l_eig_mat_inv_tr(1, n1-1) = 0.5*(gamma-1.0)*(nx+u1/a)/a;
1447 l_eig_mat_inv_tr(n1-1, n1-1) = 0.5*(1.0+(gamma-1.0)*(u+k/a)/a);
1453 switch (dim_for_eig_vec)
1463 l_eig_mat(0, 2) = nz*u1/nx-u3;
1464 l_eig_mat(1, 2) = -nz/nx;
1465 l_eig_mat(3, 2) = 1.0;
1471 l_eig_mat(0, 1) = ny*u1/nx-u2;
1472 l_eig_mat(1, 1) = -ny/nx;
1473 l_eig_mat(2, 1) = 1.0;
1479 l_eig_mat(0, 0) = u*u1/nx-(cv*T*gamma+k);
1480 l_eig_mat(1, 0) = -u/nx;
1481 l_eig_mat(n1-1, 0) = 1.0;
1495 l_eig_mat(0, 2) = nz*u2/ny-u3;
1496 l_eig_mat(2, 2) = -nz/ny;
1497 l_eig_mat(3, 2) = 1.0;
1504 l_eig_mat(0, 0) = nx*u2/ny-u1;
1505 l_eig_mat(1, 0) = 1.0;
1506 l_eig_mat(2, 0) = -nx/ny;
1509 l_eig_mat(0, 1) = u*u2/ny-(cv*T*gamma+k);
1510 l_eig_mat(2, 1) = -u/ny;
1511 l_eig_mat(n1-1, 1) = 1.0;
1522 l_eig_mat(0, 0) = nx*u3/nz-u1;
1523 l_eig_mat(1, 0) = 1.0;
1524 l_eig_mat(3, 0) = -nx/nz;
1527 l_eig_mat(0, 1) = ny*u3/nz-u2;
1528 l_eig_mat(2, 1) = 1.0;
1529 l_eig_mat(3, 1) = -ny/nz;
1532 l_eig_mat(0, 2) = u*u3/nz-(cv*T*gamma+k);
1533 l_eig_mat(3, 2) = -u/nz;
1534 l_eig_mat(n1-1, 2) = 1.0;
1547 const unsigned int n1 = 2 +
dim;
1585 const libMesh::Point& nvec,
1604 const unsigned int n1 = 2 +
dim;
1621 mat(1, 3) = -R/cv*nvec(0)*u3;
1623 mat(2, 3) = -R/cv*nvec(1)*u3;
1625 mat(3, 0) = nvec(2)*R/cv*k;
1626 mat(3, 1) = -R/cv*nvec(2)*u1;
1627 mat(3, 2) = -R/cv*nvec(2)*u2;
1628 mat(3, 3) = ui_ni-R/cv*nvec(2)*u3;
1629 mat(3, n1-1) = R/cv*nvec(2);
1631 mat(n1-1, 3) = -ui_ni*R/cv*u3;
1636 mat(1, 2) = -R/cv*nvec(0)*u2;
1638 mat(2, 0) = nvec(1)*R/cv*k;
1639 mat(2, 1) = -R/cv*nvec(1)*u1;
1640 mat(2, 2) = ui_ni-R/cv*nvec(1)*u2;
1641 mat(2, n1-1) = R/cv*nvec(1);
1643 mat(n1-1, 2) = -ui_ni*R/cv*u2;
1650 mat(1, 0) = nvec(0)*R/cv*k;
1651 mat(1, 1) = ui_ni-R/cv*nvec(0)*u1;
1652 mat(1, n1-1) = R/cv*nvec(0);
1654 mat(n1-1, 0) = ui_ni*R/cv*k;
1655 mat(n1-1, 1) = -ui_ni*R/cv*u1;
1656 mat(n1-1, n1-1) = ui_ni*(1.+R/cv);
1685 if (dnormal.norm() > 0.)
1688 duini_dU = RealVectorX::Zero(n1),
1689 tmp = RealVectorX::Zero(n1);
1693 tmp(n1-1) = e+p/rho;
1694 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++) {
1699 duini_dU(0) -= u1 * dnormal(0);
1705 duini_dU(0) -= u2 * dnormal(1);
1711 duini_dU(0) -= u3 * dnormal(2);
1716 duini_dU(i_dim+1) = dnormal(i_dim);
1720 for (
unsigned int i=0; i<n1; i++)
1721 for (
unsigned int j=0; j<n1; j++)
1723 mat(i,j) -= tmp(i)*duini_dU(j);
1743 const unsigned int n1 = 2 +
dim;
1754 dUdV.setZero(); dVdU.setZero();
1767 dUdV(3, 0) = dUdV(0, 3);
1768 dUdV(3, 1) = dUdV(1, 3);
1769 dUdV(3, 2) = dUdV(2, 3);
1770 dUdV(3, 3) = u3*u3+cv*T*(gamma-1.0);
1771 dUdV(3, n1-1) = u3*(cv*T*gamma+k);
1773 dUdV(n1-1, 3) = dUdV(3, n1-1);
1782 dUdV(2, 0) = dUdV(0, 2);
1783 dUdV(2, 1) = dUdV(1, 2);
1784 dUdV(2, 2) = u2*u2+cv*T*(gamma-1.0);
1785 dUdV(2, n1-1) = u2*(cv*T*gamma+k);
1787 dUdV(n1-1, 2) = dUdV(2, n1-1);
1794 dUdV(0, n1-1) = e_tot;
1796 dUdV(1, 0) = dUdV(0, 1);
1797 dUdV(1, 1) = u1*u1+cv*T*(gamma-1.0);
1798 dUdV(1, n1-1) = u1*(cv*T*gamma+k);
1800 dUdV(n1-1, 0) = dUdV(0, n1-1);
1801 dUdV(n1-1, 1) = dUdV(1, n1-1);
1802 dUdV(n1-1, n1-1) = k*k+gamma*cv*T*(cv*T+2*k);
1811 dUdV *= rho/(gamma-1.0);
1825 dVdU(3, 0) = dVdU(0, 3);
1826 dVdU(3, 1) = dVdU(1, 3);
1827 dVdU(3, 2) = dVdU(2, 3);
1828 dVdU(3, 3) = u3*u3+cv*T;
1829 dVdU(3, n1-1) = -u3;
1831 dVdU(n1-1, 3) = dVdU(3, n1-1);
1840 dVdU(2, 0) = dVdU(0, 2);
1841 dVdU(2, 1) = dVdU(1, 2);
1842 dVdU(2, 2) = u2*u2+cv*T;
1843 dVdU(2, n1-1) = -u2;
1845 dVdU(n1-1, 2) = dVdU(2, n1-1);
1850 dVdU(0, 0) = k*k+cv*cv*T*T*gamma;
1852 dVdU(0, n1-1) = -e_tot+2.0*k;
1854 dVdU(1, 0) = dVdU(0, 1);
1855 dVdU(1, 1) = u1*u1+cv*T;
1856 dVdU(1, n1-1) = -u1;
1858 dVdU(n1-1, 0) = dVdU(0, n1-1);
1859 dVdU(n1-1, 1) = dVdU(1, n1-1);
1860 dVdU(n1-1, n1-1) = 1.0;
1868 dVdU /= (rho*cv*cv*T*T);
1880 std::vector<RealMatrixX >& tau_sens) {
1882 const unsigned int n1 = 2 +
dim;
1884 libMesh::Point nvec;
1886 eig_val = RealVectorX::Zero(n1);
1889 l_eig_vec = RealMatrixX::Zero(n1, n1),
1890 l_eig_vec_inv_tr = RealMatrixX::Zero(n1, n1),
1891 tmp1 = RealMatrixX::Zero(n1, n1);
1895 const std::vector<std::vector<libMesh::RealVectorValue> >&
1898 for (
unsigned int i_node=0; i_node<dphi.size(); i_node++)
1900 nvec = dphi[i_node][qp];
1906 (sol, nvec, eig_val, l_eig_vec, l_eig_vec_inv_tr);
1908 for (
unsigned int i_var=0; i_var<n1; i_var++)
1909 l_eig_vec_inv_tr.col(i_var) *= fabs(eig_val(i_var));
1911 l_eig_vec_inv_tr *= l_eig_vec.transpose();
1913 tmp1 += nval * l_eig_vec_inv_tr;
1920 for (
unsigned int i_node=0; i_node<dphi.size(); i_node++) {
1922 nvec = dphi[i_node][qp];
1924 for (
unsigned int i=0; i<
dim; i++)
1925 for (
unsigned int j=0; j<
dim; j++) {
1928 tmp1 += l_eig_vec * nvec(i) * nvec(j);
1936 x = RealVectorX::Zero(n1),
1937 b = RealVectorX::Zero(n1);
1939 for (
unsigned int i_var=0; i_var<n1; i_var++) {
1941 tau_sens[i_var].setZero();
1942 b.setZero(); b(i_var) = 1.;
1943 x = tmp1.lu().solve(b);
1958 std::vector<RealMatrixX >& tau_sens) {
1960 const unsigned int n1 = 2 +
dim;
1962 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi =
1966 u = RealVectorX::Zero(
dim),
1967 dN = RealVectorX::Zero(
dim);
1998 Real h = 0, u_val = u.norm(), tau_rho, tau_m, tau_e;
2001 for (
unsigned int i_nodes=0; i_nodes<dphi.size(); i_nodes++)
2004 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++)
2005 dN(i_dim) = dphi[i_nodes][qp](i_dim);
2007 h += fabs(dN.dot(u));
2013 tau_rho = 1.0/sqrt(pow(2.0/dt, 2)+ pow(2.0/h*(u_val+a), 2));
2016 tau_m = 1.0/sqrt(pow(2.0/dt, 2)+ pow(2.0/h*(u_val+a), 2));
2017 tau_e = 1.0/sqrt(pow(2.0/dt, 2)+ pow(2.0/h*(u_val+a), 2));
2021 tau_m = 1.0/sqrt(pow(2.0/dt, 2)+ pow(2.0/h*(u_val+a), 2) +
2022 pow(4.0*sol.
mu/sol.
rho/h/h, 2));
2023 tau_e = 1.0/sqrt(pow(2.0/dt, 2)+ pow(2.0/h*(u_val+a), 2)+
2027 tau(0, 0) = tau_rho;
2028 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++)
2029 tau(1+i_dim, 1+i_dim) = tau_m;
2030 tau(n1-1, n1-1) = tau_e;
2033 std::vector<Real> primitive_sens(n1), cons_sens(n1);
2036 for (
unsigned int i_pvar=0; i_pvar<n1; i_pvar++)
2041 primitive_sens[i_pvar] = 0.;
2045 primitive_sens[i_pvar] = 2.0*u1/sqrt(2.0*sol.
k)/h;
2049 primitive_sens[i_pvar] = 2.0*u2/sqrt(2.0*sol.
k)/h;
2053 primitive_sens[i_pvar] = 2.0*u3/sqrt(2.0*sol.
k)/h;
2057 primitive_sens[i_pvar] = sqrt(gamma*R/sol.
T)/h;
2065 dprim_dcons = RealMatrixX::Zero(n1, n1),
2066 dcons_dprim = RealMatrixX::Zero(n1, n1);
2068 std::fill(cons_sens.begin(), cons_sens.end(), 0.);
2071 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
2073 for (
unsigned int i_pvar=0; i_pvar<n1; i_pvar++)
2074 cons_sens[i_cvar] += primitive_sens[i_pvar] *
2075 dprim_dcons(i_pvar, i_cvar);
2079 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
2081 tau_sens[i_cvar].setZero();
2082 cons_sens[i_cvar] *= -pow(2.0/h*(u_val+a),-2.0);
2083 for (
unsigned int i=0; i<n1; i++)
2084 tau_sens[i_cvar](i,i) = cons_sens[i_cvar];
2101 dxi_dX.setZero(); dX_dxi.setZero();
2102 Real val=0., val2=0.;
2104 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++)
2105 for (
unsigned int j_dim=0; j_dim<
dim; j_dim++)
2167 dxi_dX(i_dim, j_dim) = val;
2168 dX_dxi(i_dim, j_dim) = val2;
2180 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
2184 discontinuity_val.setZero();
2185 const unsigned int n1 = 2 +
dim;
2188 tmpmat1_n1n1 = RealMatrixX::Zero(
dim+2,
dim+2),
2189 dxi_dX = RealMatrixX::Zero(
dim,
dim),
2190 dX_dxi = RealMatrixX::Zero(
dim,
dim),
2191 dpdc = RealMatrixX::Zero(n1, n1),
2192 dcdp = RealMatrixX::Zero(n1, n1);
2194 vec1 = RealVectorX::Zero(n1),
2195 vec2 = RealVectorX::Zero(n1),
2196 dpress_dp = RealVectorX::Zero(n1),
2197 dp = RealVectorX::Zero(
dim),
2198 hk = RealVectorX::Zero(
dim);
2202 vec2 = Ai_Bi_advection * elem_solution;
2206 dpress_dp(0) = (sol.
cp - sol.
cv)*sol.
T;
2207 dpress_dp(n1-1) = (sol.
cp - sol.
cv)*sol.
rho;
2208 vec1 = dpdc.transpose() * dpress_dp;
2210 Real rp = fabs(vec2.dot(vec1)) / sol.
p;
2213 this->calculate_dxidX (qp, fe, dxi_dX, dX_dxi);
2214 for (
unsigned int i=0; i<
dim; i++) {
2216 for (
unsigned int j=0; j<
dim; j++)
2217 hk(i) = fmax(hk(i), fabs(dX_dxi(i, j)));
2220 dB_mat[i].vector_mult(vec1, elem_solution);
2222 dp(i) = vec2.dot(dpress_dp);
2225 const unsigned int fe_order = fe.
get_fe_type().order;
2228 for (
unsigned int i=0; i<
dim; i++)
2229 discontinuity_val(i) =
2230 (dp.norm() * hk(i) / sol.
p / (fe_order + 1)) *
2243 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
2248 discontinuity_val.setZero();
2249 const unsigned int n1 = 2 +
dim;
2251 std::vector<RealVectorX >
2254 A_inv_entropy = RealMatrixX::Zero(
dim+2,
dim+2),
2255 A_entropy = RealMatrixX::Zero(
dim+2,
dim+2),
2256 dxi_dX = RealMatrixX::Zero(
dim,
dim),
2257 dX_dxi = RealMatrixX::Zero(
dim,
dim),
2258 tmpmat1_n1n1 = RealMatrixX::Zero(n1, n1);
2260 vec1 = RealVectorX::Zero(n1),
2261 vec2 = RealVectorX::Zero(n1);
2263 for (
unsigned int i=0; i<
dim; i++) diff_vec[i].setZero(n1);
2271 for (
unsigned int i=0; i<
dim; i++)
2272 dB_mat[i].vector_mult(diff_vec[i], elem_solution);
2273 vec1 = Ai_Bi_advection * elem_solution;
2280 vec2 = A_inv_entropy * vec1;
2281 dval = vec1.dot(vec2);
2288 for (
unsigned int i=0; i<
dim; i++) {
2291 for (
unsigned int j=0; j<
dim; j++)
2292 vec1 += dxi_dX(i, j) * diff_vec[j];
2295 vec2 = A_inv_entropy * vec1;
2296 val1 += vec1.dot(vec2);
2332 dval = sqrt(dval/val1);
2337 dpdc = RealMatrixX::Zero(n1, n1),
2338 dcdp = RealMatrixX::Zero(n1, n1);
2341 dpress_dp = RealVectorX::Zero(n1, n1),
2342 dp = RealVectorX::Zero(dim);
2344 Real p_sensor = 0., hk = 0.;
2346 dpress_dp(0) = (sol.
cp - sol.
cv)*sol.
T;
2347 dpress_dp(n1-1) = (sol.
cp - sol.
cv)*sol.
rho;
2348 for (
unsigned int i=0; i<
dim; i++) {
2349 dB_mat[i].vector_mult(vec1, elem_solution);
2351 dp(i) = vec2.dot(dpress_dp);
2352 for (
unsigned int j=0; j<
dim; j++)
2353 hk = fmax(hk, fabs(dX_dxi(i, j)));
2355 p_sensor = dp.norm() * hk / sol.
p;
2362 const unsigned int fe_order = fe.
get_fe_type().order;
2363 for (
unsigned int i=0; i<
dim; i++)
2364 discontinuity_val(i) = dval/fe_order;
2370 template <
typename ValType>
2374 (
const unsigned int qp,
2379 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
2384 discontinuity_val.setZero();
2385 const unsigned int n1 = 2 +
dim;
2387 std::vector<RealVectorX >
2391 A_inv_entropy = RealMatrixX::Zero(
dim+2,
dim+2),
2392 A_entropy = RealMatrixX::Zero(
dim+2,
dim+2),
2393 dxi_dX = RealMatrixX::Zero(
dim,
dim),
2394 dX_dxi = RealMatrixX::Zero(
dim,
dim),
2395 tmpmat1_n1n1 = RealMatrixX::Zero(
dim+2,
dim+2);
2397 vec1 = RealVectorX::Zero(n1),
2398 vec2 = RealVectorX::Zero(n1);
2400 for (
unsigned int i=0; i<
dim; i++) diff_vec[i].setZero(n1);
2408 for (
unsigned int i=0; i<
dim; i++)
2409 dB_mat[i].vector_mult(diff_vec[i], elem_solution);
2410 vec1 = Ai_Bi_advection * elem_solution;
2417 vec2 = A_inv_entropy * vec1;
2418 dval = vec1.dot(vec2);
2425 for (
unsigned int i=0; i<
dim; i++) {
2428 for (
unsigned int j=0; j<
dim; j++)
2429 vec1 += dxi_dX(i, j) * diff_vec[j];
2432 vec2 = A_inv_entropy * vec1;
2433 val1 += vec1.dot(vec2);
2436 dval = std::min(1., sqrt(dval/val1));
2441 dpdc = RealMatrixX::Zero(n1, n1),
2442 dcdp = RealMatrixX::Zero(n1, n1);
2444 dpress_dp = RealVectorX::Zero(n1),
2445 dp = RealVectorX::Zero(dim);
2447 Real p_sensor = 0., hk = 0.;
2449 dpress_dp(0) = (sol.
cp - sol.
cv)*sol.
T;
2450 dpress_dp(n1-1) = (sol.
cp - sol.
cv)*sol.
rho;
2451 for (
unsigned int i=0; i<
dim; i++) {
2452 dB_mat[i].vector_mult(vec1, elem_solution);
2454 dp(i) = vec2.dot(dpress_dp);
2455 for (
unsigned int j=0; j<
dim; j++)
2456 hk = fmax(hk, fabs(dX_dxi(i, j)));
2458 p_sensor = std::min(1.,
2460 (sol.
p + abs(dsol.
dp)));
2467 const unsigned int fe_order = fe.
get_fe_type().order;
2468 for (
unsigned int i=0; i<
dim; i++)
2469 discontinuity_val(i) = dval/fe_order;
2480 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
2481 const std::vector<RealMatrixX >& Ai_advection,
2483 const std::vector<std::vector<RealMatrixX > >& Ai_sens,
2487 const unsigned int n1 = 2 +
dim, n2 = B_mat.
n();
2490 mat = RealMatrixX::Zero(n1, n2),
2491 mat2 = RealMatrixX::Zero(n1, n2),
2492 tau = RealMatrixX::Zero(n1, n1);
2494 vec1 = RealVectorX::Zero(n1),
2495 vec2 = RealVectorX::Zero(n1),
2496 vec3 = RealVectorX::Zero(n1),
2497 vec4_n2 = RealVectorX::Zero(n2);
2500 const std::vector<std::vector<Real> >& phi =
2502 const unsigned int n_phi = (
unsigned int) phi.size();
2503 std::vector<RealMatrixX > tau_sens(n1);
2504 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
2505 tau_sens[i_cvar].setZero(n1, n1);
2508 LS_operator.setZero();
2511 bool if_diagonal_tau =
false;
2514 vec2 = Ai_Bi_advection * elem_solution;
2519 (qp, fe, sol, tau, tau_sens);
2522 for (
unsigned int i=0; i<
dim; i++)
2524 mat = Ai_advection[i].transpose();
2525 dB_mat[i].left_multiply(mat2, mat);
2526 LS_operator += mat2;
2532 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
2534 vec3 = Ai_sens[i][i_cvar] * vec1;
2535 dB_mat[i].vector_mult_transpose(vec4_n2, vec3);
2536 for (
unsigned int i_phi=0; i_phi<n_phi; i_phi++)
2537 LS_sens.col((n_phi*i_cvar)+i_phi) += phi[i_phi][qp] * vec4_n2;
2541 for (
unsigned int i_cvar=0; i_cvar<n1; i_cvar++)
2543 vec1 = tau_sens[i_cvar] * vec2;
2544 vec3 = Ai_advection[i] * vec1;
2545 dB_mat[i].vector_mult_transpose(vec4_n2, vec3);
2546 for (
unsigned int i_phi=0; i_phi<n_phi; i_phi++)
2547 LS_sens.col((n_phi*i_cvar)+i_phi) += phi[i_phi][qp] * vec4_n2;
2552 if (if_diagonal_tau) {
2554 for (
unsigned int i=0; i<n1; i++)
2555 LS_operator.row(i) *= tau(i,i);
2558 LS_operator = tau.transpose() * LS_operator;
2565 MAST::FluidElemBase::
2566 calculate_small_disturbance_aliabadi_discontinuity_operator<Real>
2567 (
const unsigned int qp,
2572 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
2579 MAST::FluidElemBase::
2580 calculate_small_disturbance_aliabadi_discontinuity_operator<Complex>
2581 (
const unsigned int qp,
2586 const std::vector<MAST::FEMOperatorMatrix>& dB_mat,
virtual const std::vector< Real > & get_detadz() const
virtual const std::vector< Real > & get_dzetadx() const
Class defines basic operations and calculation of the small disturbance primitive variables...
void calculate_advection_flux(const unsigned int calculate_dim, const MAST::PrimitiveSolution &sol, RealVectorX &flux)
void calculate_advection_flux_jacobian_for_moving_solid_wall_boundary(const MAST::PrimitiveSolution &sol, const Real ui_ni, const libMesh::Point &nvec, const RealVectorX &dnvec, RealMatrixX &mat)
virtual const std::vector< libMesh::RealVectorValue > & get_dxyzdzeta() const
FluidElemBase(const unsigned int dimension, const MAST::FlightCondition &f)
Constructor.
void reinit(unsigned int n_interpolated_vars, unsigned int n_discrete_vars, unsigned int n_discrete_dofs_per_var)
this initializes the operator for number of rows and variables, assuming that all variables has the s...
virtual const std::vector< Real > & get_dxidy() const
void calculate_diffusion_tensors_sensitivity(const RealVectorX &elem_sol, const RealVectorX &elem_sol_sens, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealMatrixX &dprim_dcons, const MAST::PrimitiveSolution &psol, const MAST::SmallPerturbationPrimitiveSolution< Real > &dsol, RealMatrixX &stress_tensor_sens, RealVectorX &temp_gradient_sens)
calculates and returns the stress tensor in stress_tensor.
bool _include_pressure_switch
virtual const std::vector< Real > & get_dxidz() const
Class defines the conversion and some basic operations on primitive fluid variables used in calculati...
void calculate_conservative_variable_jacobian(const MAST::PrimitiveSolution &sol, RealMatrixX &dcons_dprim, RealMatrixX &dprim_dcons)
virtual const std::vector< Real > & get_detadx() const
void calculate_advection_flux_jacobian_sensitivity_for_primitive_variable(const unsigned int calculate_dim, const unsigned int primitive_var, const MAST::PrimitiveSolution &sol, RealMatrixX &mat)
void update_solution_at_quadrature_point(const unsigned int qp, const MAST::FEBase &fe, const RealVectorX &elem_solution, RealVectorX &conservative_sol, MAST::PrimitiveSolution &primitive_sol, MAST::FEMOperatorMatrix &B_mat, std::vector< MAST::FEMOperatorMatrix > &dB_mat)
bool calculate_aliabadi_tau_matrix(const unsigned int qp, const MAST::FEBase &fe, const MAST::PrimitiveSolution &sol, RealMatrixX &tau, std::vector< RealMatrixX > &tau_sens)
void calculate_advection_flux_jacobian_sensitivity_for_conservative_variable(const unsigned int calculate_dim, const MAST::PrimitiveSolution &sol, std::vector< RealMatrixX > &mat)
virtual const std::vector< libMesh::RealVectorValue > & get_dxyzdeta() const
virtual const std::vector< Real > & get_dzetady() const
void calculate_diffusion_flux(const unsigned int calculate_dim, const MAST::PrimitiveSolution &sol, const RealMatrixX &stress_tensor, const RealVectorX &temp_gradient, RealVectorX &flux)
void calculate_diffusion_tensors(const RealVectorX &elem_sol, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealMatrixX &dprim_dcons, const MAST::PrimitiveSolution &psol, RealMatrixX &stress_tensor, RealVectorX &temp_gradient)
calculates and returns the stress tensor in stress_tensor.
void calculate_diffusion_flux_jacobian(const unsigned int flux_dim, const unsigned int deriv_dim, const MAST::PrimitiveSolution &sol, RealMatrixX &mat)
std::vector< FluidConservativeVars > _active_conservative_vars
const MAST::FlightCondition * flight_condition
This defines the surface motion for use with the nonlinear fluid solver.
Real _dissipation_scaling
virtual const std::vector< Real > & get_dzetadz() const
void calculate_small_disturbance_aliabadi_discontinuity_operator(const unsigned int qp, const MAST::FEBase &fe, const MAST::PrimitiveSolution &sol, const MAST::SmallPerturbationPrimitiveSolution< ValType > &dsol, const RealVectorX &elem_solution, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealMatrixX &Ai_Bi_advection, RealVectorX &discontinuity_val)
void calculate_entropy_variable_jacobian(const MAST::PrimitiveSolution &sol, RealMatrixX &dUdV, RealMatrixX &dVdU)
void calculate_advection_flux_jacobian(const unsigned int calculate_dim, const MAST::PrimitiveSolution &sol, RealMatrixX &mat)
Matrix< Real, Dynamic, Dynamic > RealMatrixX
void calculate_aliabadi_discontinuity_operator(const unsigned int qp, const MAST::FEBase &fe, const MAST::PrimitiveSolution &sol, const RealVectorX &elem_solution, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealMatrixX &Ai_Bi_advection, RealVectorX &discontinuity_val)
void vector_mult(T &res, const T &v) const
res = [this] * v
Matrix< Real, Dynamic, 1 > RealVectorX
void calculate_differential_operator_matrix(const unsigned int qp, const MAST::FEBase &fe, const RealVectorX &elem_solution, const MAST::PrimitiveSolution &sol, const MAST::FEMOperatorMatrix &B_mat, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const std::vector< RealMatrixX > &Ai_advection, const RealMatrixX &Ai_Bi_advection, const std::vector< std::vector< RealMatrixX > > &Ai_sens, RealMatrixX &LS_operator, RealMatrixX &LS_sens)
virtual const std::vector< Real > & get_detady() const
void init(const unsigned int dim, const RealVectorX &conservative_sol, const Real cp_val, const Real cv_val, bool if_viscous)
virtual const std::vector< Real > & get_dxidx() const
void calculate_pressure_derivative_wrt_conservative_variables(const MAST::PrimitiveSolution &sol, RealVectorX &dpdX)
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
GasProperty gas_property
Ambient air properties.
void calculate_hartmann_discontinuity_operator(const unsigned int qp, const MAST::FEBase &fe, const MAST::PrimitiveSolution &sol, const RealVectorX &elem_solution, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealMatrixX &Ai_Bi_advection, RealVectorX &discontinuity_val)
virtual const std::vector< libMesh::RealVectorValue > & get_dxyzdxi() const
void calculate_dxidX(const unsigned int qp, const MAST::FEBase &fe, RealMatrixX &dxi_dX, RealMatrixX &dX_dxi)
virtual const std::vector< std::vector< Real > > & get_phi() const
void calculate_diffusion_flux_jacobian_primitive_vars(const unsigned int flux_dim, const unsigned int deriv_dim, const RealVectorX &uvec, const bool zero_kth, const MAST::PrimitiveSolution &sol, RealMatrixX &mat)
bool calculate_barth_tau_matrix(const unsigned int qp, const MAST::FEBase &fe, const MAST::PrimitiveSolution &sol, RealMatrixX &tau, std::vector< RealMatrixX > &tau_sens)
libMesh::FEType get_fe_type() const
void calculate_advection_left_eigenvector_and_inverse_for_normal(const MAST::PrimitiveSolution &sol, const libMesh::Point &normal, RealVectorX &eig_vals, RealMatrixX &l_eig_mat, RealMatrixX &l_eig_mat_inv_tr)
std::vector< MAST::FluidPrimitiveVars > _active_primitive_vars
void get_infinity_vars(RealVectorX &vars_inf) const