50 "CompressibleFlowSystem",
52 "Auxiliary functions for the compressible flow system.");
56 : UnsteadySystem(pSession)
65 UnsteadySystem::v_InitObject();
68 "No UPWINDTYPE defined in session.");
78 m_vecLocs[0][i] = 1 + i;
83 "Compressible flow sessions must define a Gamma parameter.");
88 "Compressible flow sessions must define a pInf parameter.");
93 "Compressible flow sessions must define a rhoInf parameter.");
98 "Compressible flow sessions must define a uInf parameter.");
104 if (m_spacedim == 2 || m_spacedim == 3)
107 "Compressible flow sessions must define a vInf parameter"
108 "for 2D/3D problems.");
117 "Compressible flow sessions must define a wInf parameter"
136 m_session->LoadSolverInfo(
"ShockCaptureType",
138 m_session->LoadParameter (
"thermalConductivity",
155 int nvariables =
m_fields.num_elements();
157 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
160 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
161 "PressureOutflowFile")
164 GetBndCondExpansions()[n]->GetNpoints();
166 for (
int i = 0; i < nvariables; ++i)
172 m_fields[i]->GetBndCondExpansions()[n]->GetPhys(), 1,
181 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
184 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
185 "PressureInflowFile")
188 GetBndCondExpansions()[n]->GetNpoints();
189 for (
int i = 0; i < nvariables; ++i)
194 m_fields[i]->GetBndCondExpansions()[n]->GetPhys(), 1,
206 ASSERTL0(
false,
"Continuous field not supported.");
212 string advName, diffName, riemName;
215 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
216 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDGNS");
257 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Average");
291 ASSERTL0(
false,
"Unsupported projection type.");
310 UnsteadySystem::v_GenerateSummary(s);
323 const std::string &userDefStr,
330 int nvariables =
m_fields.num_elements();
332 if(!userDefStr.empty())
334 if(boost::iequals(userDefStr,
"Wall"))
338 else if(boost::iequals(userDefStr,
"WallViscous") ||
339 boost::iequals(userDefStr,
"WallAdiabatic"))
344 else if(boost::iequals(userDefStr,
"Symmetry"))
349 else if(boost::iequals(userDefStr,
"RiemannInvariant"))
354 else if(boost::iequals(userDefStr,
"PressureOutflowNonReflective"))
359 else if(boost::iequals(userDefStr,
"PressureOutflow"))
364 else if(boost::iequals(userDefStr,
"PressureOutflowFile"))
369 else if(boost::iequals(userDefStr,
"PressureInflowFile"))
374 else if(boost::iequals(userDefStr,
"ExtrapOrder0"))
379 else if(boost::iequals(userDefStr,
"TimeDependent"))
381 for (
int i = 0; i < nvariables; ++i)
384 m_fields[i]->EvaluateBoundaryConditions(time, varName);
389 string errmsg =
"Unrecognised boundary condition: ";
390 errmsg += userDefStr;
406 int nVariables = physarray.num_elements();
413 for (i = 0; i < nVariables; ++i)
416 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
421 int e, id1, id2, nBCEdgePts, eMax;
423 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
425 for (e = 0; e < eMax; ++e)
427 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
428 GetExp(e)->GetTotPoints();
429 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
431 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
442 &Fwd[nVariables-1][id2], 1,
446 &Fwd[nVariables-1][id2], 1,
448 &Fwd[nVariables-1][id2], 1);
452 &Fwd[nVariables-1][id2], 1,
453 &Fwd[nVariables-1][id2], 1);
471 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
484 for (i = 0; i < nVariables; ++i)
487 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
488 UpdatePhys())[id1], 1);
503 int nVariables = physarray.num_elements();
510 for (i = 0; i < nVariables; ++i)
513 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
519 int e, id1, id2, nBCEdgePts, eMax;
521 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
523 for (e = 0; e < eMax; ++e)
525 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
526 GetExp(e)->GetTotPoints();
527 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
529 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
539 &Fwd[nVariables-1][id2], 1,
543 &Fwd[nVariables-1][id2], 1,
545 &Fwd[nVariables-1][id2], 1);
549 &Fwd[nVariables-1][id2], 1,
550 &Fwd[nVariables-1][id2], 1);
559 for (i = 0; i < nVariables; ++i)
562 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
563 UpdatePhys())[id1], 1);
578 int nVariables = physarray.num_elements();
585 for (i = 0; i < nVariables; ++i)
588 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
593 int e, id1, id2, nBCEdgePts, eMax;
595 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
597 for (e = 0; e < eMax; ++e)
599 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
600 GetExp(e)->GetTotPoints();
601 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
603 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
613 &Fwd[nVariables-1][id2], 1,
617 &Fwd[nVariables-1][id2], 1,
619 &Fwd[nVariables-1][id2], 1);
623 &Fwd[nVariables-1][id2], 1,
624 &Fwd[nVariables-1][id2], 1);
641 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
654 for (i = 0; i < nVariables; ++i)
657 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
658 UpdatePhys())[id1], 1);
674 int nVariables = physarray.num_elements();
683 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
694 if (nDimensions == 2 || nDimensions == 3)
698 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
700 if (nDimensions == 3)
704 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
709 for (i = 0; i < nVariables; ++i)
712 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
719 for (i = 0; i < nDimensions; ++i)
721 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
728 for (i = 0; i < nDimensions; ++i)
730 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
732 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
740 for (i = 0; i < nTracePts; i++)
744 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
745 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
749 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
750 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
751 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
755 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
756 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
757 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
758 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
761 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
766 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
771 int e, id1, id2, nBCEdgePts, pnt;
772 NekDouble cPlus, rPlus, cMinus, rMinus, VDBC, VNBC;
777 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
780 for (e = 0; e < eMax; ++e)
782 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
783 GetExp(e)->GetTotPoints();
785 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
787 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
790 for (i = 0; i < nBCEdgePts; i++)
798 if (Mach[pnt] < 1.00)
801 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
802 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
806 rMinus = VnInf[pnt] - 2.0 * cMinus * gammaMinusOneInv;
812 rPlus = VnInf[pnt] + 2.0 * cPlus * gammaMinusOneInv;
816 rMinus = VnInf[pnt] - 2.0 * cPlus * gammaMinusOneInv;
820 VNBC = 0.5 * (rPlus + rMinus);
821 cBC = 0.25 * gammaMinusOne * (rPlus - rMinus);
822 VDBC = VNBC - VnInf[pnt];
826 rhoBC = pow((cBC * cBC) / (gamma * sBC), gammaMinusOneInv);
827 pBC = rhoBC * cBC * cBC * gammaInv;
833 for ( j = 0; j < nDimensions; ++j)
836 rhoVelBC[j] = rhoBC * velBC[j];
837 EkBC += 0.5 * rhoBC * velBC[j]*velBC[j];
841 EBC = pBC * gammaMinusOneInv + EkBC;
844 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
845 UpdatePhys())[id1+i] = rhoBC;
846 for (j = 0; j < nDimensions; ++j)
848 (
m_fields[j+1]->GetBndCondExpansions()[bcRegion]->
849 UpdatePhys())[id1+i] = rhoVelBC[j];
851 (
m_fields[nDimensions+1]->GetBndCondExpansions()[bcRegion]->
852 UpdatePhys())[id1+i] = EBC;
858 if (Mach[pnt] < 1.00)
861 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
862 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
866 rMinus = VnInf[pnt] - 2.0 * cMinus * gammaMinusOneInv;
871 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
872 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
875 cMinus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
876 rMinus = Vn[pnt] - 2.0 * cPlus * gammaMinusOneInv;
880 VNBC = 0.5 * (rPlus + rMinus);
881 cBC = 0.25 * gammaMinusOne * (rPlus - rMinus);
882 VDBC = VNBC - Vn[pnt];
885 sBC = pressure[pnt] / (pow(Fwd[0][pnt], gamma));
886 rhoBC = pow((cBC * cBC) / (gamma * sBC), gammaMinusOneInv);
887 pBC = rhoBC * cBC * cBC * gammaInv;
893 for ( j = 0; j < nDimensions; ++j)
895 velBC[j] = Fwd[j+1][pnt] / Fwd[0][pnt] +
897 rhoVelBC[j] = rhoBC * velBC[j];
898 EkBC += 0.5 * rhoBC * velBC[j]*velBC[j];
902 EBC = pBC * gammaMinusOneInv + EkBC;
905 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
906 UpdatePhys())[id1+i] = rhoBC;
907 for (j = 0; j < nDimensions; ++j)
909 (
m_fields[j+1]->GetBndCondExpansions()[bcRegion]->
910 UpdatePhys())[id1+i] = rhoVelBC[j];
912 (
m_fields[nDimensions+1]->GetBndCondExpansions()[bcRegion]->
913 UpdatePhys())[id1+i] = EBC;
931 int nVariables = physarray.num_elements();
939 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
950 if (nDimensions == 2 || nDimensions == 3)
954 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
956 if (nDimensions == 3)
960 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
965 for (i = 0; i < nVariables; ++i)
968 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
975 for (i = 0; i < nDimensions; ++i)
977 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
984 for (i = 0; i < nDimensions; ++i)
986 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
988 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
996 for (i = 0; i < nTracePts; i++)
1000 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1001 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1005 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1006 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1007 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1011 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1012 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1013 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1014 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1017 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1022 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1026 int e, id1, id2,
npts, pnt;
1030 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1033 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1034 GetExp(e)->GetTotPoints();
1035 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1037 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1040 for (i = 0; i <
npts; i++)
1045 if (Mach[pnt] < 0.99)
1049 for (j = 1; j < nVariables-1; ++j)
1051 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1054 rhoeb =
m_pInf * gammaMinusOneInv + Ek;
1057 for (j = 0; j < nVariables-1; ++j)
1059 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1060 UpdatePhys())[id1+i] = Fwd[j][pnt];
1063 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1064 UpdatePhys())[id1+i] = 2.0 * rhoeb - Fwd[nVariables-1][pnt];
1069 for (j = 0; j < nVariables; ++j)
1072 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1073 UpdatePhys())[id1+i] = Fwd[j][pnt];
1091 int nVariables = physarray.num_elements();
1099 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1110 if (nDimensions == 2 || nDimensions == 3)
1114 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1116 if (nDimensions == 3)
1120 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1125 for (i = 0; i < nVariables; ++i)
1128 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1135 for (i = 0; i < nDimensions; ++i)
1137 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1144 for (i = 0; i < nDimensions; ++i)
1146 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1147 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1148 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1156 for (i = 0; i < nTracePts; i++)
1160 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1161 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1165 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1166 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1167 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1171 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1172 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1173 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1174 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1177 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1182 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1186 int e, id1, id2,
npts, pnt;
1190 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1193 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1194 GetExp(e)->GetTotPoints();
1195 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1197 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1200 for (i = 0; i <
npts; i++)
1205 if (Mach[pnt] < 0.99)
1209 for (j = 1; j < nVariables-1; ++j)
1211 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1214 rhoeb =
m_pInf * gammaMinusOneInv + Ek;
1217 for (j = 0; j < nVariables-1; ++j)
1219 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1220 UpdatePhys())[id1+i] = Fwd[j][pnt];
1223 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1224 UpdatePhys())[id1+i] = rhoeb;
1229 for (j = 0; j < nVariables; ++j)
1232 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1233 UpdatePhys())[id1+i] = Fwd[j][pnt];
1252 int nVariables = physarray.num_elements();
1260 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1271 if (nDimensions == 2 || nDimensions == 3)
1275 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1277 if (nDimensions == 3)
1281 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1287 for (i = 0; i < nVariables; ++i)
1290 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1297 for (i = 0; i < nDimensions; ++i)
1299 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1306 for (i = 0; i < nDimensions; ++i)
1308 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1309 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1310 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1318 for (i = 0; i < nTracePts; i++)
1322 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1323 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1327 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1328 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1329 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1333 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1334 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1335 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1336 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1339 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1344 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1348 int e, id1, id2,
npts, pnt;
1352 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1355 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1356 GetExp(e)->GetTotPoints();
1357 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1359 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1362 for (i = 0; i <
npts; i++)
1367 if (Mach[pnt] < 0.99)
1371 for (j = 1; j < nVariables-1; ++j)
1373 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1379 for (j = 0; j < nVariables-1; ++j)
1381 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1382 UpdatePhys())[id1+i] = Fwd[j][pnt];
1385 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1386 UpdatePhys())[id1+i] = rhoeb;
1391 for (j = 0; j < nVariables; ++j)
1394 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1395 UpdatePhys())[id1+i] = Fwd[j][pnt];
1416 int nVariables = physarray.num_elements();
1424 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1435 if (nDimensions == 2 || nDimensions == 3)
1439 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1441 if (nDimensions == 3)
1445 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1451 for (i = 0; i < nVariables; ++i)
1454 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1461 for (i = 0; i < nDimensions; ++i)
1463 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1470 for (i = 0; i < nDimensions; ++i)
1472 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1473 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1474 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1482 for (i = 0; i < nTracePts; i++)
1486 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1487 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1491 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1492 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1493 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1497 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1498 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1499 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1500 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1503 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1508 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1512 int e, id1, id2,
npts, pnt;
1516 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1519 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1520 GetExp(e)->GetTotPoints();
1521 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1523 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1526 for (i = 0; i <
npts; i++)
1531 if (Mach[pnt] < 0.99)
1534 for (j = 0; j < nVariables-1; ++j)
1536 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1542 for (j = 1; j < nVariables-1; ++j)
1548 rhoeb = gammaMinusOneInv * pressure[pnt] + Ek;
1550 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1551 UpdatePhys())[id1+i] = rhoeb;
1556 for (j = 0; j < nVariables; ++j)
1559 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1560 UpdatePhys())[id1+i] = Fwd[j][pnt];
1579 int id1, id2, nBCEdgePts;
1581 int nVariables = physarray.num_elements();
1589 for (i = 0; i < nVariables; ++i)
1592 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1597 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
1600 for (e = 0; e < eMax; ++e)
1602 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1603 GetExp(e)->GetTotPoints();
1604 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1606 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1609 for (i = 0; i < nBCEdgePts; i++)
1614 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1615 UpdatePhys())[id1+i] = Fwd[0][pnt];
1618 for (j = 1; j <=nDimensions; ++j)
1620 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1621 UpdatePhys())[id1+i] = Fwd[j][pnt];
1625 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1626 UpdatePhys())[id1+i] = Fwd[nVariables-1][pnt];
1643 int nq = physfield[0].num_elements();
1644 int nVariables =
m_fields.num_elements();
1664 Vmath::Vmul(nq, velocity[j], 1, physfield[i+1], 1,
1669 Vmath::Vadd(nq, flux[i+1][i], 1, pressure, 1, flux[i+1][i], 1);
1673 Vmath::Vadd(nq, physfield[m_spacedim+1], 1, pressure, 1,
1679 flux[m_spacedim+1][j], 1);
1683 if (nVariables == m_spacedim+3)
1706 int nq = physfield[0].num_elements();
1707 int nVariables =
m_fields.num_elements();
1711 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
1720 for (i = 0; i < nVariables; ++ i)
1725 OneDptscale, physfield[i], physfield_interp[i]);
1739 m_fields[0]->PhysGalerkinProjection1DScaled(
1740 OneDptscale, physfield_interp[i+1], flux[0][i]);
1744 GetPressure (physfield_interp, velocity, pressure);
1751 Vmath::Vmul(nq, velocity[j], 1, physfield_interp[i+1], 1,
1752 flux_interp[i+1][j], 1);
1756 Vmath::Vadd(nq, flux_interp[i+1][i], 1, pressure,1,
1757 flux_interp[i+1][i], 1);
1765 m_fields[0]->PhysGalerkinProjection1DScaled(
1766 OneDptscale, flux_interp[i+1][j], flux[i+1][j]);
1771 Vmath::Vadd(nq, physfield_interp[m_spacedim+1], 1, pressure, 1,
1777 flux_interp[m_spacedim+1][j], 1);
1780 m_fields[0]->PhysGalerkinProjection1DScaled(
1782 flux_interp[m_spacedim+1][j],
1783 flux[m_spacedim+1][j]);
1798 int nVariables =
m_fields.num_elements();
1799 int nPts = physfield[0].num_elements();
1815 Vmath::Smul(nPts, tRa, &mu[0], 1, &thermalConductivity[0], 1);
1821 &thermalConductivity[0], 1);
1834 Vmath::Vadd(nPts, &divVel[0], 1, &derivativesO1[j][j][0], 1,
1839 Vmath::Smul(nPts, lambda, &divVel[0], 1, &divVel[0], 1);
1840 Vmath::Vmul(nPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
1849 Vmath::Vmul(nPts, &mu2[0], 1, &derivativesO1[j][j][0], 1,
1852 Vmath::Vadd(nPts, &tmp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
1861 if (m_spacedim == 2)
1865 &derivativesO1[1][0][0], 1, &Sxy[0], 1);
1868 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
1870 else if (m_spacedim == 3)
1874 &derivativesO1[1][0][0], 1, &Sxy[0], 1);
1878 &derivativesO1[2][0][0], 1, &Sxz[0], 1);
1882 &derivativesO1[2][1][0], 1, &Syz[0], 1);
1885 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
1888 Vmath::Vmul(nPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
1891 Vmath::Vmul(nPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
1907 if (m_spacedim == 1)
1912 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1916 &derivativesO1[0][1][0], 1, &tmp1[0], 1);
1919 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1921 else if (m_spacedim == 2)
1929 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1932 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1936 &derivativesO1[0][2][0], 1, &tmp2[0], 1);
1939 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1940 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
1949 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sgg[1][0], 1, &STy[0], 1);
1952 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1956 &derivativesO1[1][2][0], 1, &tmp2[0], 1);
1959 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
1960 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
1962 else if (m_spacedim == 3)
1971 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1974 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1977 Vmath::Vmul(nPts, &physfield[2][0], 1, &Sxz[0], 1, &tmp2[0], 1);
1981 &derivativesO1[0][3][0], 1, &tmp3[0], 1);
1984 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1985 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
1986 Vmath::Vadd(nPts, &STx[0], 1, &tmp3[0], 1, &STx[0], 1);
1996 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sgg[1][0], 1, &STy[0], 1);
1999 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxy[0], 1, &tmp1[0], 1);
2002 Vmath::Vmul(nPts, &physfield[2][0], 1, &Syz[0], 1, &tmp2[0], 1);
2006 &derivativesO1[1][3][0], 1, &tmp3[0], 1);
2009 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2010 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2011 Vmath::Vadd(nPts, &STy[0], 1, &tmp3[0], 1, &STy[0], 1);
2021 Vmath::Vmul(nPts, &physfield[2][0], 1, &Sgg[2][0], 1, &STz[0], 1);
2024 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxz[0], 1, &tmp1[0], 1);
2027 Vmath::Vmul(nPts, &physfield[1][0], 1, &Syz[0], 1, &tmp2[0], 1);
2031 &derivativesO1[2][3][0], 1, &tmp3[0], 1);
2034 Vmath::Vadd(nPts, &STz[0], 1, &tmp1[0], 1, &STz[0], 1);
2035 Vmath::Vadd(nPts, &STz[0], 1, &tmp2[0], 1, &STz[0], 1);
2036 Vmath::Vadd(nPts, &STz[0], 1, &tmp3[0], 1, &STz[0], 1);
2047 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2050 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][2][0], 1);
2061 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2063 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[1][1][0], 1);
2066 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[0][2][0], 1);
2068 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor[1][2][0], 1);
2071 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][3][0], 1);
2073 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor[1][3][0], 1);
2086 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2088 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[1][1][0], 1);
2090 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor[2][1][0], 1);
2093 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[0][2][0], 1);
2095 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor[1][2][0], 1);
2097 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor[2][2][0], 1);
2100 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor[0][3][0], 1);
2102 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor[1][3][0], 1);
2104 Vmath::Vcopy(nPts, &Sgg[2][0], 1, &viscousTensor[2][3][0], 1);
2107 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][4][0], 1);
2109 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor[1][4][0], 1);
2111 Vmath::Vcopy(nPts, &STz[0], 1, &viscousTensor[2][4][0], 1);
2116 ASSERTL0(
false,
"Illegal expansion dimension");
2132 int nVariables =
m_fields.num_elements();
2133 int nPts = physfield[0].num_elements();
2135 int variables_phys = physfield.num_elements();
2141 nPts =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
2143 int nVariables_aux = derivativesO1[0].num_elements();
2155 for (j = 0; j < nVariables; ++j)
2171 for (i = 0; i < nVariables; ++i)
2174 OneDptscale, physfield[i], fields_interp[i]);
2177 for (i = 0; i < variables_phys; ++i)
2182 m_fields[0]->PhysInterp1DScaled(OneDptscale, physfield[i],
2183 physfield_interp[i]);
2190 for (j = 0; j < nVariables_aux; ++j)
2194 OneDptscale, derivativesO1[i][j],
2195 derivativesO1_interp[i][j]);
2223 Vmath::Vadd(nPts, &divVel[0], 1, &derivativesO1_interp[j][j][0], 1,
2228 Vmath::Smul(nPts, lambda, &divVel[0], 1, &divVel[0], 1);
2229 Vmath::Vmul(nPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
2238 Vmath::Vmul(nPts, &mu2[0], 1, &derivativesO1_interp[j][j][0], 1,
2241 Vmath::Vadd(nPts, &tmp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
2250 if (m_spacedim == 2)
2253 Vmath::Vadd(nPts, &derivativesO1_interp[0][1][0], 1,
2254 &derivativesO1_interp[1][0][0], 1, &Sxy[0], 1);
2257 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
2259 else if (m_spacedim == 3)
2262 Vmath::Vadd(nPts, &derivativesO1_interp[0][1][0], 1,
2263 &derivativesO1_interp[1][0][0], 1, &Sxy[0], 1);
2266 Vmath::Vadd(nPts, &derivativesO1_interp[0][2][0], 1,
2267 &derivativesO1_interp[2][0][0], 1, &Sxz[0], 1);
2270 Vmath::Vadd(nPts, &derivativesO1_interp[1][2][0], 1,
2271 &derivativesO1_interp[2][1][0], 1, &Syz[0], 1);
2274 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
2277 Vmath::Vmul(nPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
2280 Vmath::Vmul(nPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
2297 if (m_spacedim == 1)
2303 &Sgg[0][0], 1, &STx[0], 1);
2307 &derivativesO1_interp[0][1][0], 1, &tmp1[0], 1);
2310 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2312 else if (m_spacedim == 2)
2321 &Sgg[0][0], 1, &STx[0], 1);
2325 &Sxy[0], 1, &tmp1[0], 1);
2329 &derivativesO1_interp[0][2][0], 1, &tmp2[0], 1);
2332 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2333 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
2343 &Sgg[1][0], 1, &STy[0], 1);
2347 &Sxy[0], 1, &tmp1[0], 1);
2351 &derivativesO1_interp[1][2][0], 1, &tmp2[0], 1);
2354 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2355 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2357 else if (m_spacedim == 3)
2367 &Sgg[0][0], 1, &STx[0], 1);
2371 &Sxy[0], 1, &tmp1[0], 1);
2375 &Sxz[0], 1, &tmp2[0], 1);
2379 &derivativesO1_interp[0][3][0], 1, &tmp3[0], 1);
2382 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2383 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
2384 Vmath::Vadd(nPts, &STx[0], 1, &tmp3[0], 1, &STx[0], 1);
2395 &Sgg[1][0], 1, &STy[0], 1);
2399 &Sxy[0], 1, &tmp1[0], 1);
2403 &Syz[0], 1, &tmp2[0], 1);
2407 &derivativesO1_interp[1][3][0], 1, &tmp3[0], 1);
2410 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2411 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2412 Vmath::Vadd(nPts, &STy[0], 1, &tmp3[0], 1, &STy[0], 1);
2423 &Sgg[2][0], 1, &STz[0], 1);
2427 &Sxz[0], 1, &tmp1[0], 1);
2431 &Syz[0], 1, &tmp2[0], 1);
2435 &derivativesO1_interp[2][3][0], 1, &tmp3[0], 1);
2438 Vmath::Vadd(nPts, &STz[0], 1, &tmp1[0], 1, &STz[0], 1);
2439 Vmath::Vadd(nPts, &STz[0], 1, &tmp2[0], 1, &STz[0], 1);
2440 Vmath::Vadd(nPts, &STz[0], 1, &tmp3[0], 1, &STz[0], 1);
2448 int nq = physfield[0].num_elements();
2450 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2453 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2456 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][2][0], 1);
2461 int nq = physfield[0].num_elements();
2463 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2465 Vmath::Zero(nq, &viscousTensor_interp[1][0][0], 1);
2468 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2470 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[1][1][0], 1);
2473 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[0][2][0], 1);
2475 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor_interp[1][2][0], 1);
2478 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][3][0], 1);
2480 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor_interp[1][3][0], 1);
2485 int nq = physfield[0].num_elements();
2487 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2489 Vmath::Zero(nq, &viscousTensor_interp[1][0][0], 1);
2491 Vmath::Zero(nq, &viscousTensor_interp[2][0][0], 1);
2494 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2496 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[1][1][0], 1);
2498 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor_interp[2][1][0], 1);
2501 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[0][2][0], 1);
2503 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor_interp[1][2][0], 1);
2505 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor_interp[2][2][0], 1);
2508 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor_interp[0][3][0], 1);
2510 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor_interp[1][3][0], 1);
2512 Vmath::Vcopy(nPts, &Sgg[2][0], 1, &viscousTensor_interp[2][3][0], 1);
2515 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][4][0], 1);
2517 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor_interp[1][4][0], 1);
2519 Vmath::Vcopy(nPts, &STz[0], 1, &viscousTensor_interp[2][4][0], 1);
2524 ASSERTL0(
false,
"Illegal expansion dimension");
2530 for (j = 1; j < nVariables; ++j)
2533 m_fields[0]->PhysGalerkinProjection1DScaled(
2535 viscousTensor_interp[i][j],
2536 viscousTensor[i][j]);
2554 int nBCEdgePts = physfield[0].num_elements();
2558 Vmath::Vmul(nBCEdgePts, physfield[1], 1, physfield[1], 1, pressure, 1);
2561 Vmath::Vvtvp(nBCEdgePts, physfield[1+i], 1, physfield[1+i], 1,
2562 pressure, 1, pressure, 1);
2565 Vmath::Vdiv (nBCEdgePts, pressure, 1, physfield[0], 1, pressure, 1);
2568 pressure, 1, physfield[m_spacedim+1], 1, pressure, 1);
2587 Vmath::Vdiv(npts, pressure, 1, physfield[0], 1, enthalpy, 1);
2589 Vmath::Vadd(npts, tmp, 1, enthalpy, 1, enthalpy, 1);
2610 int nBCEdgePts = physfield[0].num_elements();
2614 Vmath::Vmul (nBCEdgePts, velocity[0], 1, physfield[1], 1, pressure, 1);
2617 Vmath::Vvtvp(nBCEdgePts, velocity[i], 1, physfield[1+i], 1,
2618 pressure, 1, pressure, 1);
2622 pressure, 1, physfield[m_spacedim+1], 1, pressure, 1);
2638 const int nBCEdgePts = physfield[0].num_elements();
2642 Vmath::Vdiv(nBCEdgePts, physfield[1+i], 1, physfield[0], 1,
2659 const int nq = physfield[0].num_elements();
2661 Vmath::Vdiv(nq, pressure, 1, physfield[0], 1, temperature, 1);
2677 const int nq =
m_fields[0]->GetTotPoints();
2678 Vmath::Vdiv (nq, pressure, 1, physfield[0], 1, soundspeed, 1);
2695 const int nq =
m_fields[0]->GetTotPoints();
2697 Vmath::Vmul(nq, physfield[1], 1, physfield[1], 1, mach, 1);
2705 Vmath::Vdiv(nq, mach, 1, physfield[0], 1, mach, 1);
2706 Vmath::Vdiv(nq, mach, 1, physfield[0], 1, mach, 1);
2725 const int nPts = temperature.num_elements();
2730 for (
int i = 0; i < nPts; ++i)
2732 ratio = temperature[i] / T_star;
2733 mu[i] = mu_star * ratio * sqrt(ratio) *
2734 (T_star + 110.0) / (temperature[i] + 110.0);
2749 if (
m_comm->GetRank() == 0)
2751 cout <<
"Reached Steady State to tolerance "
2767 const int nFields =
m_fields.num_elements();
2773 for (
int i = 0; i < nFields; ++i)
2785 L2[0] = sqrt(residual[0]) /
m_rhoInf;
2787 for (
int i = 1; i < nFields-1; ++i)
2793 L2[nFields-1] = sqrt(residual[nFields-1]) / Einf;
2795 if (
m_comm->GetRank() == 0 && output)
2801 for (
int i = 0; i < nFields; ++i)
2803 m_errFile << setprecision(11) << setw(22) << scientific
2813 if (
m_session->DefinesCmdLineArgument(
"verbose") &&
2814 m_comm->GetRank() == 0 && output)
2816 cout <<
"-- Maximum L^2 residual: " << maxL2 << endl;
2837 const int npts =
m_fields[0]->GetTotPoints();
2841 for (
int i = 0; i <
npts; ++i)
2845 log(pressure[i] /
m_pInf);
2848 Vmath::Vmul(npts, entropy, 1, entropy, 1, L2entropy, 1);
2852 entropy_sum = sqrt(entropy_sum);
2854 std::ofstream m_file(
"L2entropy.txt", std::ios_base::app);
2856 m_file << setprecision(16) << scientific << entropy_sum << endl;
2869 int nElements =
m_fields[0]->GetExpSize();
2884 for(n = 0; n < nElements; ++n)
2886 int npoints =
m_fields[0]->GetExp(n)->GetTotPoints();
2890 minLength = sqrt(Area);
2891 if (
m_fields[0]->GetExp(n)->as<LocalRegions::TriExp>())
2897 / (stdVelocity[n] * cLambda
2898 * (ExpOrder[n] - 1) * (ExpOrder[n] - 1));
2912 bool dumpInitialConditions,
2915 if (
m_session->DefinesParameter(
"SteadyStateTol"))
2917 const int nPoints =
m_fields[0]->GetTotPoints();
2921 for (
int i = 0; i <
m_fields.num_elements(); ++i)
2928 if (
m_comm->GetRank() == 0)
2930 std::string fName =
m_session->GetSessionName() +
2931 std::string(
".res");
2934 << setw(15) << left <<
"Time"
2935 << setw(22) << left <<
"rho";
2937 std::string velFields[3] = {
"u",
"v",
"w"};
2939 for (
int i = 0; i <
m_fields.num_elements()-2; ++i)
2941 m_errFile << setw(22) <<
"rho"+velFields[i];
2944 m_errFile << setw(22) << left <<
"E" << endl;
2962 int n_element =
m_fields[0]->GetExpSize();
2985 for(
int el = 0; el < n_element; ++el)
2987 ptsKeys =
m_fields[0]->GetExp(el)->GetPointsKeys();
2991 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo();
2993 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()
2994 ->GetDerivFactors(ptsKeys);
2996 int nq =
m_fields[0]->GetExp(el)->GetTotPoints();
3008 1, stdVelocity[i], 1, stdVelocity[i], 1);
3021 1, stdVelocity[i], 1, stdVelocity[i], 1);
3026 for (
int i = 0; i < nq; ++i)
3031 pntVelocity += stdVelocity[j][i]*stdVelocity[j][i];
3033 pntVelocity = sqrt(pntVelocity) + soundspeed[nBCEdgePts];
3034 if (pntVelocity > stdV[el])
3036 stdV[el] = pntVelocity;
3052 ASSERTL0(n <= 20,
"Illegal modes dimension for CFL calculation "
3053 "(P has to be less then 20)");
3055 NekDouble CFLDG[21] = { 2.0000, 6.0000, 11.8424, 19.1569,
3056 27.8419, 37.8247, 49.0518, 61.4815,
3057 75.0797, 89.8181, 105.6700, 122.6200,
3058 140.6400, 159.7300, 179.8500, 201.0100,
3059 223.1800, 246.3600, 270.5300, 295.6900,
3069 ASSERTL0(
false,
"Continuous Galerkin stability coefficients "
3070 "not introduced yet.");
3088 for (i =0; i<
m_fields[0]->GetExpSize(); i++)
3100 int e, NumModesElement, nQuadPointsElement;
3102 int nElements =
m_fields[0]->GetExpSize();
3113 Vmath::Vcopy(nTotQuadPoints, physarray[0], 1, SolP, 1);
3115 int CoeffsCount = 0;
3117 for (e = 0; e < nElements; e++)
3119 NumModesElement = ExpOrderElement[e];
3120 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3121 int nCoeffsElement =
m_fields[0]->GetExp(e)->GetNcoeffs();
3122 int numCutOff = NumModesElement - 1;
3135 for (
int i = 0; i < nQuadPointsElement; i++)
3137 SolPElementPhys[i] = SolP[CoeffsCount+i];
3140 m_fields[0]->GetExp(e)->FwdTrans(SolPElementPhys,
3148 m_fields[0]->GetExp(e)->ReduceOrderCoeffs(numCutOff,
3150 SolPmOneElementCoeffs);
3152 m_fields[0]->GetExp(e)->BwdTrans(SolPmOneElementCoeffs,
3153 SolPmOneElementPhys);
3155 for (
int i = 0; i < nQuadPointsElement; i++)
3157 SolPmOne[CoeffsCount+i] = SolPmOneElementPhys[i];
3167 SolPmOneElementPhys, 1,
3175 for (
int i = 0; i < nQuadPointsElement; i++)
3177 SolPmeanNumerator += SolNorm[i];
3178 SolPmeanDenumerator += SolPElementPhys[i];
3181 for (
int i = 0; i < nQuadPointsElement; ++i)
3183 Sensor[CoeffsCount+i] =
3184 sqrt(SolPmeanNumerator / nQuadPointsElement) /
3185 sqrt(SolPmeanDenumerator / nQuadPointsElement);
3187 Sensor[CoeffsCount+i] = log10(Sensor[CoeffsCount+i]);
3189 CoeffsCount += nQuadPointsElement;
3194 for (e = 0; e < nElements; e++)
3196 NumModesElement = ExpOrderElement[e];
3200 nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3202 for (
int i = 0; i < nQuadPointsElement; i++)
3204 if (Sensor[CoeffsCount+i] <= (Phi0 - DeltaPhi))
3206 SensorKappa[CoeffsCount+i] = 0;
3208 else if(Sensor[CoeffsCount+i] >= (Phi0 + DeltaPhi))
3210 SensorKappa[CoeffsCount+i] = ThetaS;
3212 else if(abs(Sensor[CoeffsCount+i]-Phi0) < DeltaPhi)
3214 SensorKappa[CoeffsCount+i] =
3215 ThetaS / 2 * (1 + sin(M_PI * (Sensor[CoeffsCount+i] -
3216 Phi0) / (2 * DeltaPhi)));
3220 CoeffsCount += nQuadPointsElement;
3229 const int nPts =
m_fields[0]->GetTotPoints();
3230 const int nvariables =
m_fields.num_elements();
3231 const int nElements =
m_fields[0]->GetExpSize();
3252 GetSensor(inarray, Sensor, SensorKappa);
3255 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
3261 for (
int e = 0; e < nElements; e++)
3263 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3265 for (
int n = 0; n < nQuadPointsElement; n++)
3267 pOrder[n + PointCount] = pOrderElmt[e];
3270 Tau[n + PointCount] =
3271 1.0 / (
m_C1*pOrder[n + PointCount]*LambdaMax);
3273 outarrayForcing[nvariables-1][n + PointCount] =
3275 pOrder[n + PointCount] *
3276 SensorKappa[n + PointCount] -
3277 inarray[nvariables-1][n + PointCount]);
3279 PointCount += nQuadPointsElement;
3288 const int nElements =
m_fields[0]->GetExpSize();
3295 for (
int e = 0; e < nElements; e++)
3300 for (
int j = 0; j < nedges; ++j)
3311 if (boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3312 m_fields[0]->GetExp(e)->GetGeom()))
3316 m_fields[0]->GetExp(e)->GetGeom());
3318 ElQuadGeom->
GetEdge(j)->GetVertex(0)->GetCoords(x0, y0, z0);
3319 ElQuadGeom->GetEdge(j)->GetVertex(1)->GetCoords(x1, y1, z1);
3321 L1[j] = sqrt(pow((x0-x1),2)+pow((y0-y1),2)+pow((z0-z1),2));
3325 ASSERTL0(
false,
"GetElementDimensions() is only "
3326 "implemented for quadrilateral elements");
3332 if(boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3333 m_fields[0]->GetExp(e)->GetGeom()))
3335 hx = min(L1[0], L1[2]);
3336 hy = min(L1[1], L1[3]);
3338 outarray[0][e] = hx;
3339 outarray[1][e] = hy;
3343 hmin[0] =
Vmath::Vmin(outarray[0].num_elements(), outarray[0], 1);
3344 hmin[1] =
Vmath::Vmin(outarray[1].num_elements(), outarray[1], 1);
3381 int nvariables = physfield.num_elements();
3382 int nPts =
m_fields[0]->GetTotPoints();
3400 GetSensor(physfield, sensor, SensorKappa);
3403 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
3421 for (
int e = 0; e < eps_bar.num_elements(); e++)
3423 if (physfield[nvariables-1][e] <= (Phi0 - DeltaPhi))
3427 else if(physfield[nvariables-1][e] >= (Phi0 + DeltaPhi))
3431 else if(abs(physfield[nvariables-1][e]-Phi0) < DeltaPhi)
3433 eps_bar[e] =
m_mu0/2*(1+sin(M_PI*
3434 (physfield[nvariables-1][e]-Phi0)/(2*DeltaPhi)));
3444 const int nElements =
m_fields[0]->GetExpSize();
3459 GetSensor (physfield, Sensor, SensorKappa);
3463 Vmath::Vadd(nTotQuadPoints, absVelocity, 1, soundspeed, 1, Lambda, 1);
3465 for (
int e = 0; e < nElements; e++)
3476 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3479 for (
int n = 0; n < nQuadPointsElement; n++)
3485 mu_var[n+PointCount] = 0;
3490 mu_var[n+PointCount] = mu_0 * (0.5 * (1 + sin(
3491 M_PI * (Sensor[n+PointCount] -
3497 mu_var[n+PointCount] = mu_0;
3501 PointCount += nQuadPointsElement;
3512 int nElements =
m_fields[0]->GetExpSize();
3513 int npts =
m_fields[0]->GetTotPoints();
3519 GetSensor(physfield, Sensor, SensorKappa);
3521 int nQuadPointsElement = 0;
3525 int MinOrderShock = 4;
3527 std::ofstream m_file(
"VariablePComposites.txt", std::ios_base::app);
3528 for (
int e = 0; e < nElements; e++)
3530 m_file <<
"<C ID=\"" << e+1 <<
"\"> Q[" << e <<
"] </C>"<< endl;
3534 std::ofstream m_file2(
"VariablePExpansions.txt", std::ios_base::app);
3536 for (e = 0; e < nElements; e++)
3538 nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3549 for (
int i = 0; i < nQuadPointsElement; i++)
3551 se[npCount + i] = (Sensor[npCount + i]);
3553 if (se[npCount + i] > s_ds)
3555 if (PolyOrder[npCount + i] > MinOrderShock)
3557 PolyOrder[npCount + i] = PolyOrder[npCount + i] - 1;
3559 else if(PolyOrder[e] < MinOrderShock)
3561 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 1;
3565 else if (se[npCount + i] > s_sm && se[npCount + i] < s_ds)
3567 if (PolyOrder[npCount + i] < MaxOrder)
3569 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 2;
3572 else if (se[npCount + i] > s_fl && se[npCount + i] < s_sm)
3574 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 1;
3576 else if (se[npCount + i] < s_fl)
3578 if (PolyOrder[npCount + i] > MinOrder)
3580 PolyOrder[npCount + i] = PolyOrder[npCount + i];
3584 m_file2 <<
"<E COMPOSITE= \"C[" << e+1
3585 <<
"]\" NUMMODES=\"" << PolyOrder[npCount + 1]
3586 <<
"\" TYPE=\"MODIFIED\" FIELDS=\"rho,rhou,rhov,rhow,E\" />"
3588 npCount += nQuadPointsElement;
3596 std::vector<std::string> &variables)
3598 const int nPhys =
m_fields[0]->GetNpoints();
3599 const int nCoeffs =
m_fields[0]->GetNcoeffs();
3602 for (
int i = 0; i <
m_fields.num_elements(); ++i)
3612 GetMach (tmp, soundspeed, mach);
3619 m_fields[0]->FwdTrans(pressure, pFwd);
3620 m_fields[0]->FwdTrans(soundspeed, sFwd);
3622 m_fields[0]->FwdTrans(sensor, sensFwd);
3623 m_fields[0]->FwdTrans(smooth, smoothFwd);
3625 variables.push_back (
"p");
3626 variables.push_back (
"a");
3627 variables.push_back (
"Mach");
3628 variables.push_back (
"Sensor");
3629 variables.push_back (
"SmoothVisc");
3630 fieldcoeffs.push_back(pFwd);
3631 fieldcoeffs.push_back(sFwd);
3632 fieldcoeffs.push_back(mFwd);
3633 fieldcoeffs.push_back(sensFwd);
3634 fieldcoeffs.push_back(smoothFwd);
void ExtrapOrder0BC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Extrapolation of order 0 for all the variables such that, at the boundaries, a trivial Riemann proble...
void GetMach(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &soundspeed, Array< OneD, NekDouble > &mach)
void RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Outflow characteristic boundary conditions for compressible flow problems.
#define ASSERTL0(condition, msg)
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
Array< OneD, Array< OneD, NekDouble > > m_fieldStorage
void SymmetryBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Symmetry boundary conditions for compressible flow problems.
void PressureOutflowNonReflectiveBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow non-reflective boundary conditions for compressible flow problems.
std::vector< PointsKey > PointsKeyVector
virtual ~CompressibleFlowSystem()
Destructor for CompressibleFlowSystem class.
void GetSoundSpeed(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &soundspeed)
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
void PressureOutflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
NekDouble m_time
Current time of simulation.
void GetViscousFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &derivatives, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the LDG diffusion problem.
void GetStdVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &stdV)
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
SolverUtils::RiemannSolverSharedPtr m_riemannSolverLDG
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
virtual bool v_PostIntegrate(int step)
std::vector< std::pair< std::string, std::string > > SummaryList
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
SOLVER_UTILS_EXPORT const Array< OneD, int > GetNumExpModesPerExp()
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
NekDouble GetStabilityLimit(int n)
Function to calculate the stability limit for DG/CG.
DiffusionFactory & GetDiffusionFactory()
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
std::string m_ViscosityType
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
void GetTemperature(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &temperature)
void GetArtificialDynamicViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu_var)
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
Array< OneD, Array< OneD, NekDouble > > m_un
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
void GetViscousFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &derivatives, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Return the flux vector for the LDG diffusion problem.
SOLVER_UTILS_EXPORT NekDouble MaxTimeStepEstimator()
Get the maximum timestep estimator for cfl control.
void PressureOutflowBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
boost::shared_ptr< HexGeom > HexGeomSharedPtr
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
NekDouble m_steadyStateTol
LibUtilities::CommSharedPtr m_comm
Communicator.
SOLVER_UTILS_EXPORT int GetTotPoints()
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void SetVarPOrderElmt(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &PolyOrder)
void SetCommonBC(const std::string &userDefStr, const int n, const NekDouble time, int &cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
Set boundary conditions which can be: a) Wall and Symmerty BCs implemented at CompressibleFlowSystem ...
void GetVelocityVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
void WallViscousBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for viscous compressible flow problems.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void GetFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Return the flux vector for the compressible Euler equations by using the de-aliasing technique...
void GetEntropy(const Array< OneD, const Array< OneD, NekDouble > > &physfield, const Array< OneD, const NekDouble > &pressure, const Array< OneD, const NekDouble > &temperature, Array< OneD, NekDouble > &entropy)
RiemannSolverFactory & GetRiemannSolverFactory()
void WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for compressible flow problems.
int m_spacedim
Spatial dimension (>= expansion dim).
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
void Neg(int n, T *x, const int incx)
Negate x = -x.
NekDouble m_cflSafetyFactor
CFL safety factor (comprise between 0 to 1).
virtual void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
bool CalcSteadyState(bool output)
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Array< OneD, NekDouble > m_pressureStorage
EquationSystemFactory & GetEquationSystemFactory()
Array< OneD, NekDouble > GetStabilityLimitVector(const Array< OneD, int > &ExpOrder)
Function to calculate the stability limit for DG/CG (a vector of them).
void GetAbsoluteVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &Vtot)
SolverUtils::AdvectionSharedPtr m_advection
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
SolverUtils::DiffusionSharedPtr m_diffusion
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
std::string m_shockCaptureType
SOLVER_UTILS_EXPORT int GetPhys_Offset(int n)
NekDouble m_thermalConductivity
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
void GetDynamicViscosity(const Array< OneD, const NekDouble > &temperature, Array< OneD, NekDouble > &mu)
virtual NekDouble v_GetTimeStep(const Array< OneD, const Array< OneD, NekDouble > > &inarray)
Return the timestep to be used for the next step in the time-marching loop.
SOLVER_UTILS_EXPORT int GetExpSize()
void GetEnthalpy(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &enthalpy)
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
void GetSmoothArtificialViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &eps_bar)
const Geometry1DSharedPtr GetEdge(int i) const
void GetForcingTerm(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > outarrayForcing)
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure()
Get pressure field if available.
int m_infosteps
Number of time steps between outputting status information.
void GetSensor(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, NekDouble > &Sensor, Array< OneD, NekDouble > &SensorKappa)
CompressibleFlowSystem(const LibUtilities::SessionReaderSharedPtr &pSession)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Return the flux vector for the compressible Euler equations.
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
void Zero(int n, T *x, const int incx)
Zero vector.
static std::string className
Name of class.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Geometry is curved or has non-constant factors.
void GetElementDimensions(Array< OneD, Array< OneD, NekDouble > > &outarray, Array< OneD, NekDouble > &hmin)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void PressureInflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure inflow boundary conditions for compressible flow problems where either the density and the v...
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.