50 string CompressibleFlowSystem::className =
52 "CompressibleFlowSystem",
53 CompressibleFlowSystem::create,
54 "Auxiliary functions for the compressible flow system.");
56 CompressibleFlowSystem::CompressibleFlowSystem(
70 "No UPWINDTYPE defined in session.");
80 m_vecLocs[0][i] = 1 + i;
85 "Compressible flow sessions must define a Gamma parameter.");
90 "Compressible flow sessions must define a pInf parameter.");
95 "Compressible flow sessions must define a rhoInf parameter.");
100 "Compressible flow sessions must define a uInf parameter.");
106 if (m_spacedim == 2 || m_spacedim == 3)
109 "Compressible flow sessions must define a vInf parameter"
110 "for 2D/3D problems.");
119 "Compressible flow sessions must define a wInf parameter"
138 m_session->LoadSolverInfo(
"ShockCaptureType",
140 m_session->LoadParameter (
"thermalConductivity",
157 int nvariables =
m_fields.num_elements();
159 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
162 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
163 "PressureOutflowFile")
166 GetBndCondExpansions()[n]->GetNpoints();
168 for (
int i = 0; i < nvariables; ++i)
174 m_fields[i]->GetBndCondExpansions()[n]->GetPhys(), 1,
183 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
186 if (
m_fields[0]->GetBndConditions()[n]->GetUserDefined() ==
187 "PressureInflowFile")
190 GetBndCondExpansions()[n]->GetNpoints();
191 for (
int i = 0; i < nvariables; ++i)
196 m_fields[i]->GetBndCondExpansions()[n]->GetPhys(), 1,
208 ASSERTL0(
false,
"Continuous field not supported.");
214 string advName, diffName, riemName;
217 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
218 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDGNS");
259 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Average");
293 ASSERTL0(
false,
"Unsupported projection type.");
325 const std::string &userDefStr,
332 int nvariables =
m_fields.num_elements();
334 if(!userDefStr.empty())
336 if(boost::iequals(userDefStr,
"Wall"))
340 else if(boost::iequals(userDefStr,
"WallViscous") ||
341 boost::iequals(userDefStr,
"WallAdiabatic"))
346 else if(boost::iequals(userDefStr,
"Symmetry"))
351 else if(boost::iequals(userDefStr,
"RiemannInvariant"))
356 else if(boost::iequals(userDefStr,
"PressureOutflowNonReflective"))
361 else if(boost::iequals(userDefStr,
"PressureOutflow"))
366 else if(boost::iequals(userDefStr,
"PressureOutflowFile"))
371 else if(boost::iequals(userDefStr,
"PressureInflowFile"))
376 else if(boost::iequals(userDefStr,
"ExtrapOrder0"))
381 else if(boost::iequals(userDefStr,
"TimeDependent"))
383 for (
int i = 0; i < nvariables; ++i)
386 m_fields[i]->EvaluateBoundaryConditions(time, varName);
391 string errmsg =
"Unrecognised boundary condition: ";
392 errmsg += userDefStr;
408 int nVariables = physarray.num_elements();
415 for (i = 0; i < nVariables; ++i)
418 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
423 int e, id1, id2, nBCEdgePts, eMax;
425 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
427 for (e = 0; e < eMax; ++e)
429 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
430 GetExp(e)->GetTotPoints();
431 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
433 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
444 &Fwd[nVariables-1][id2], 1,
448 &Fwd[nVariables-1][id2], 1,
450 &Fwd[nVariables-1][id2], 1);
454 &Fwd[nVariables-1][id2], 1,
455 &Fwd[nVariables-1][id2], 1);
473 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
486 for (i = 0; i < nVariables; ++i)
489 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
490 UpdatePhys())[id1], 1);
505 int nVariables = physarray.num_elements();
512 for (i = 0; i < nVariables; ++i)
515 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
521 int e, id1, id2, nBCEdgePts, eMax;
523 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
525 for (e = 0; e < eMax; ++e)
527 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
528 GetExp(e)->GetTotPoints();
529 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
531 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
541 &Fwd[nVariables-1][id2], 1,
545 &Fwd[nVariables-1][id2], 1,
547 &Fwd[nVariables-1][id2], 1);
551 &Fwd[nVariables-1][id2], 1,
552 &Fwd[nVariables-1][id2], 1);
561 for (i = 0; i < nVariables; ++i)
564 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
565 UpdatePhys())[id1], 1);
580 int nVariables = physarray.num_elements();
587 for (i = 0; i < nVariables; ++i)
590 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
595 int e, id1, id2, nBCEdgePts, eMax;
597 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
599 for (e = 0; e < eMax; ++e)
601 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
602 GetExp(e)->GetTotPoints();
603 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
605 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
615 &Fwd[nVariables-1][id2], 1,
619 &Fwd[nVariables-1][id2], 1,
621 &Fwd[nVariables-1][id2], 1);
625 &Fwd[nVariables-1][id2], 1,
626 &Fwd[nVariables-1][id2], 1);
643 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
656 for (i = 0; i < nVariables; ++i)
659 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
660 UpdatePhys())[id1], 1);
676 int nVariables = physarray.num_elements();
685 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
696 if (nDimensions == 2 || nDimensions == 3)
700 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
702 if (nDimensions == 3)
706 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
711 for (i = 0; i < nVariables; ++i)
714 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
721 for (i = 0; i < nDimensions; ++i)
723 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
730 for (i = 0; i < nDimensions; ++i)
732 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
734 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
742 for (i = 0; i < nTracePts; i++)
746 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
747 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
751 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
752 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
753 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
757 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
758 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
759 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
760 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
763 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
768 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
773 int e, id1, id2, nBCEdgePts, pnt;
774 NekDouble cPlus, rPlus, cMinus, rMinus, VDBC, VNBC;
779 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
782 for (e = 0; e < eMax; ++e)
784 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
785 GetExp(e)->GetTotPoints();
787 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
789 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
792 for (i = 0; i < nBCEdgePts; i++)
800 if (Mach[pnt] < 1.00)
803 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
804 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
808 rMinus = VnInf[pnt] - 2.0 * cMinus * gammaMinusOneInv;
814 rPlus = VnInf[pnt] + 2.0 * cPlus * gammaMinusOneInv;
818 rMinus = VnInf[pnt] - 2.0 * cPlus * gammaMinusOneInv;
822 VNBC = 0.5 * (rPlus + rMinus);
823 cBC = 0.25 * gammaMinusOne * (rPlus - rMinus);
824 VDBC = VNBC - VnInf[pnt];
828 rhoBC = pow((cBC * cBC) / (gamma * sBC), gammaMinusOneInv);
829 pBC = rhoBC * cBC * cBC * gammaInv;
835 for ( j = 0; j < nDimensions; ++j)
838 rhoVelBC[j] = rhoBC * velBC[j];
839 EkBC += 0.5 * rhoBC * velBC[j]*velBC[j];
843 EBC = pBC * gammaMinusOneInv + EkBC;
846 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
847 UpdatePhys())[id1+i] = rhoBC;
848 for (j = 0; j < nDimensions; ++j)
850 (
m_fields[j+1]->GetBndCondExpansions()[bcRegion]->
851 UpdatePhys())[id1+i] = rhoVelBC[j];
853 (
m_fields[nDimensions+1]->GetBndCondExpansions()[bcRegion]->
854 UpdatePhys())[id1+i] = EBC;
860 if (Mach[pnt] < 1.00)
863 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
864 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
868 rMinus = VnInf[pnt] - 2.0 * cMinus * gammaMinusOneInv;
873 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
874 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
877 cMinus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
878 rMinus = Vn[pnt] - 2.0 * cPlus * gammaMinusOneInv;
882 VNBC = 0.5 * (rPlus + rMinus);
883 cBC = 0.25 * gammaMinusOne * (rPlus - rMinus);
884 VDBC = VNBC - Vn[pnt];
887 sBC = pressure[pnt] / (pow(Fwd[0][pnt], gamma));
888 rhoBC = pow((cBC * cBC) / (gamma * sBC), gammaMinusOneInv);
889 pBC = rhoBC * cBC * cBC * gammaInv;
895 for ( j = 0; j < nDimensions; ++j)
897 velBC[j] = Fwd[j+1][pnt] / Fwd[0][pnt] +
899 rhoVelBC[j] = rhoBC * velBC[j];
900 EkBC += 0.5 * rhoBC * velBC[j]*velBC[j];
904 EBC = pBC * gammaMinusOneInv + EkBC;
907 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
908 UpdatePhys())[id1+i] = rhoBC;
909 for (j = 0; j < nDimensions; ++j)
911 (
m_fields[j+1]->GetBndCondExpansions()[bcRegion]->
912 UpdatePhys())[id1+i] = rhoVelBC[j];
914 (
m_fields[nDimensions+1]->GetBndCondExpansions()[bcRegion]->
915 UpdatePhys())[id1+i] = EBC;
933 int nVariables = physarray.num_elements();
941 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
952 if (nDimensions == 2 || nDimensions == 3)
956 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
958 if (nDimensions == 3)
962 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
967 for (i = 0; i < nVariables; ++i)
970 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
977 for (i = 0; i < nDimensions; ++i)
979 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
986 for (i = 0; i < nDimensions; ++i)
988 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
990 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
998 for (i = 0; i < nTracePts; i++)
1002 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1003 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1007 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1008 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1009 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1013 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1014 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1015 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1016 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1019 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1024 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1028 int e, id1, id2,
npts, pnt;
1032 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1035 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1036 GetExp(e)->GetTotPoints();
1037 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1039 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1042 for (i = 0; i <
npts; i++)
1047 if (Mach[pnt] < 0.99)
1051 for (j = 1; j < nVariables-1; ++j)
1053 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1056 rhoeb =
m_pInf * gammaMinusOneInv + Ek;
1059 for (j = 0; j < nVariables-1; ++j)
1061 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1062 UpdatePhys())[id1+i] = Fwd[j][pnt];
1065 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1066 UpdatePhys())[id1+i] = 2.0 * rhoeb - Fwd[nVariables-1][pnt];
1071 for (j = 0; j < nVariables; ++j)
1074 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1075 UpdatePhys())[id1+i] = Fwd[j][pnt];
1093 int nVariables = physarray.num_elements();
1101 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1112 if (nDimensions == 2 || nDimensions == 3)
1116 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1118 if (nDimensions == 3)
1122 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1127 for (i = 0; i < nVariables; ++i)
1130 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1137 for (i = 0; i < nDimensions; ++i)
1139 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1146 for (i = 0; i < nDimensions; ++i)
1148 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1149 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1150 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1158 for (i = 0; i < nTracePts; i++)
1162 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1163 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1167 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1168 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1169 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1173 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1174 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1175 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1176 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1179 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1184 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1188 int e, id1, id2,
npts, pnt;
1192 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1195 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1196 GetExp(e)->GetTotPoints();
1197 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1199 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1202 for (i = 0; i <
npts; i++)
1207 if (Mach[pnt] < 0.99)
1211 for (j = 1; j < nVariables-1; ++j)
1213 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1216 rhoeb =
m_pInf * gammaMinusOneInv + Ek;
1219 for (j = 0; j < nVariables-1; ++j)
1221 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1222 UpdatePhys())[id1+i] = Fwd[j][pnt];
1225 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1226 UpdatePhys())[id1+i] = rhoeb;
1231 for (j = 0; j < nVariables; ++j)
1234 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1235 UpdatePhys())[id1+i] = Fwd[j][pnt];
1254 int nVariables = physarray.num_elements();
1262 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1273 if (nDimensions == 2 || nDimensions == 3)
1277 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1279 if (nDimensions == 3)
1283 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1289 for (i = 0; i < nVariables; ++i)
1292 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1299 for (i = 0; i < nDimensions; ++i)
1301 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1308 for (i = 0; i < nDimensions; ++i)
1310 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1311 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1312 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1320 for (i = 0; i < nTracePts; i++)
1324 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1325 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1329 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1330 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1331 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1335 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1336 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1337 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1338 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1341 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1346 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1350 int e, id1, id2,
npts, pnt;
1354 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1357 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1358 GetExp(e)->GetTotPoints();
1359 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1361 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1364 for (i = 0; i <
npts; i++)
1369 if (Mach[pnt] < 0.99)
1373 for (j = 1; j < nVariables-1; ++j)
1375 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1381 for (j = 0; j < nVariables-1; ++j)
1383 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1384 UpdatePhys())[id1+i] = Fwd[j][pnt];
1387 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1388 UpdatePhys())[id1+i] = rhoeb;
1393 for (j = 0; j < nVariables; ++j)
1396 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1397 UpdatePhys())[id1+i] = Fwd[j][pnt];
1418 int nVariables = physarray.num_elements();
1426 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1437 if (nDimensions == 2 || nDimensions == 3)
1441 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1443 if (nDimensions == 3)
1447 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1453 for (i = 0; i < nVariables; ++i)
1456 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1463 for (i = 0; i < nDimensions; ++i)
1465 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1472 for (i = 0; i < nDimensions; ++i)
1474 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1475 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1476 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1484 for (i = 0; i < nTracePts; i++)
1488 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1489 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1493 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1494 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1495 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1499 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1500 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1501 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1502 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1505 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1510 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1514 int e, id1, id2,
npts, pnt;
1518 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1521 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1522 GetExp(e)->GetTotPoints();
1523 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1525 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1528 for (i = 0; i <
npts; i++)
1533 if (Mach[pnt] < 0.99)
1536 for (j = 0; j < nVariables-1; ++j)
1538 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1544 for (j = 1; j < nVariables-1; ++j)
1550 rhoeb = gammaMinusOneInv * pressure[pnt] + Ek;
1552 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1553 UpdatePhys())[id1+i] = rhoeb;
1558 for (j = 0; j < nVariables; ++j)
1561 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1562 UpdatePhys())[id1+i] = Fwd[j][pnt];
1581 int id1, id2, nBCEdgePts;
1583 int nVariables = physarray.num_elements();
1591 for (i = 0; i < nVariables; ++i)
1594 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
1599 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
1602 for (e = 0; e < eMax; ++e)
1604 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1605 GetExp(e)->GetTotPoints();
1606 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1608 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1611 for (i = 0; i < nBCEdgePts; i++)
1616 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1617 UpdatePhys())[id1+i] = Fwd[0][pnt];
1620 for (j = 1; j <=nDimensions; ++j)
1622 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1623 UpdatePhys())[id1+i] = Fwd[j][pnt];
1627 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1628 UpdatePhys())[id1+i] = Fwd[nVariables-1][pnt];
1645 int nq = physfield[0].num_elements();
1646 int nVariables =
m_fields.num_elements();
1666 Vmath::Vmul(nq, velocity[j], 1, physfield[i+1], 1,
1671 Vmath::Vadd(nq, flux[i+1][i], 1, pressure, 1, flux[i+1][i], 1);
1675 Vmath::Vadd(nq, physfield[m_spacedim+1], 1, pressure, 1,
1681 flux[m_spacedim+1][j], 1);
1685 if (nVariables == m_spacedim+3)
1708 int nq = physfield[0].num_elements();
1709 int nVariables =
m_fields.num_elements();
1713 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
1722 for (i = 0; i < nVariables; ++ i)
1727 OneDptscale, physfield[i], physfield_interp[i]);
1741 m_fields[0]->PhysGalerkinProjection1DScaled(
1742 OneDptscale, physfield_interp[i+1], flux[0][i]);
1746 GetPressure (physfield_interp, velocity, pressure);
1753 Vmath::Vmul(nq, velocity[j], 1, physfield_interp[i+1], 1,
1754 flux_interp[i+1][j], 1);
1758 Vmath::Vadd(nq, flux_interp[i+1][i], 1, pressure,1,
1759 flux_interp[i+1][i], 1);
1767 m_fields[0]->PhysGalerkinProjection1DScaled(
1768 OneDptscale, flux_interp[i+1][j], flux[i+1][j]);
1773 Vmath::Vadd(nq, physfield_interp[m_spacedim+1], 1, pressure, 1,
1779 flux_interp[m_spacedim+1][j], 1);
1782 m_fields[0]->PhysGalerkinProjection1DScaled(
1784 flux_interp[m_spacedim+1][j],
1785 flux[m_spacedim+1][j]);
1800 int nVariables =
m_fields.num_elements();
1801 int nPts = physfield[0].num_elements();
1817 Vmath::Smul(nPts, tRa, &mu[0], 1, &thermalConductivity[0], 1);
1823 &thermalConductivity[0], 1);
1836 Vmath::Vadd(nPts, &divVel[0], 1, &derivativesO1[j][j][0], 1,
1841 Vmath::Smul(nPts, lambda, &divVel[0], 1, &divVel[0], 1);
1842 Vmath::Vmul(nPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
1851 Vmath::Vmul(nPts, &mu2[0], 1, &derivativesO1[j][j][0], 1,
1854 Vmath::Vadd(nPts, &tmp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
1863 if (m_spacedim == 2)
1867 &derivativesO1[1][0][0], 1, &Sxy[0], 1);
1870 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
1872 else if (m_spacedim == 3)
1876 &derivativesO1[1][0][0], 1, &Sxy[0], 1);
1880 &derivativesO1[2][0][0], 1, &Sxz[0], 1);
1884 &derivativesO1[2][1][0], 1, &Syz[0], 1);
1887 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
1890 Vmath::Vmul(nPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
1893 Vmath::Vmul(nPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
1909 if (m_spacedim == 1)
1914 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1918 &derivativesO1[0][1][0], 1, &tmp1[0], 1);
1921 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1923 else if (m_spacedim == 2)
1931 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1934 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1938 &derivativesO1[0][2][0], 1, &tmp2[0], 1);
1941 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1942 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
1951 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sgg[1][0], 1, &STy[0], 1);
1954 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1958 &derivativesO1[1][2][0], 1, &tmp2[0], 1);
1961 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
1962 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
1964 else if (m_spacedim == 3)
1973 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1976 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1979 Vmath::Vmul(nPts, &physfield[2][0], 1, &Sxz[0], 1, &tmp2[0], 1);
1983 &derivativesO1[0][3][0], 1, &tmp3[0], 1);
1986 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1987 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
1988 Vmath::Vadd(nPts, &STx[0], 1, &tmp3[0], 1, &STx[0], 1);
1998 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sgg[1][0], 1, &STy[0], 1);
2001 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxy[0], 1, &tmp1[0], 1);
2004 Vmath::Vmul(nPts, &physfield[2][0], 1, &Syz[0], 1, &tmp2[0], 1);
2008 &derivativesO1[1][3][0], 1, &tmp3[0], 1);
2011 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2012 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2013 Vmath::Vadd(nPts, &STy[0], 1, &tmp3[0], 1, &STy[0], 1);
2023 Vmath::Vmul(nPts, &physfield[2][0], 1, &Sgg[2][0], 1, &STz[0], 1);
2026 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxz[0], 1, &tmp1[0], 1);
2029 Vmath::Vmul(nPts, &physfield[1][0], 1, &Syz[0], 1, &tmp2[0], 1);
2033 &derivativesO1[2][3][0], 1, &tmp3[0], 1);
2036 Vmath::Vadd(nPts, &STz[0], 1, &tmp1[0], 1, &STz[0], 1);
2037 Vmath::Vadd(nPts, &STz[0], 1, &tmp2[0], 1, &STz[0], 1);
2038 Vmath::Vadd(nPts, &STz[0], 1, &tmp3[0], 1, &STz[0], 1);
2049 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2052 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][2][0], 1);
2063 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2065 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[1][1][0], 1);
2068 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[0][2][0], 1);
2070 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor[1][2][0], 1);
2073 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][3][0], 1);
2075 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor[1][3][0], 1);
2088 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2090 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[1][1][0], 1);
2092 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor[2][1][0], 1);
2095 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[0][2][0], 1);
2097 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor[1][2][0], 1);
2099 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor[2][2][0], 1);
2102 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor[0][3][0], 1);
2104 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor[1][3][0], 1);
2106 Vmath::Vcopy(nPts, &Sgg[2][0], 1, &viscousTensor[2][3][0], 1);
2109 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][4][0], 1);
2111 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor[1][4][0], 1);
2113 Vmath::Vcopy(nPts, &STz[0], 1, &viscousTensor[2][4][0], 1);
2118 ASSERTL0(
false,
"Illegal expansion dimension");
2134 int nVariables =
m_fields.num_elements();
2135 int nPts = physfield[0].num_elements();
2137 int variables_phys = physfield.num_elements();
2143 nPts =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
2145 int nVariables_aux = derivativesO1[0].num_elements();
2157 for (j = 0; j < nVariables; ++j)
2173 for (i = 0; i < nVariables; ++i)
2176 OneDptscale, physfield[i], fields_interp[i]);
2179 for (i = 0; i < variables_phys; ++i)
2184 m_fields[0]->PhysInterp1DScaled(OneDptscale, physfield[i],
2185 physfield_interp[i]);
2192 for (j = 0; j < nVariables_aux; ++j)
2196 OneDptscale, derivativesO1[i][j],
2197 derivativesO1_interp[i][j]);
2225 Vmath::Vadd(nPts, &divVel[0], 1, &derivativesO1_interp[j][j][0], 1,
2230 Vmath::Smul(nPts, lambda, &divVel[0], 1, &divVel[0], 1);
2231 Vmath::Vmul(nPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
2240 Vmath::Vmul(nPts, &mu2[0], 1, &derivativesO1_interp[j][j][0], 1,
2243 Vmath::Vadd(nPts, &tmp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
2252 if (m_spacedim == 2)
2255 Vmath::Vadd(nPts, &derivativesO1_interp[0][1][0], 1,
2256 &derivativesO1_interp[1][0][0], 1, &Sxy[0], 1);
2259 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
2261 else if (m_spacedim == 3)
2264 Vmath::Vadd(nPts, &derivativesO1_interp[0][1][0], 1,
2265 &derivativesO1_interp[1][0][0], 1, &Sxy[0], 1);
2268 Vmath::Vadd(nPts, &derivativesO1_interp[0][2][0], 1,
2269 &derivativesO1_interp[2][0][0], 1, &Sxz[0], 1);
2272 Vmath::Vadd(nPts, &derivativesO1_interp[1][2][0], 1,
2273 &derivativesO1_interp[2][1][0], 1, &Syz[0], 1);
2276 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
2279 Vmath::Vmul(nPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
2282 Vmath::Vmul(nPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
2299 if (m_spacedim == 1)
2305 &Sgg[0][0], 1, &STx[0], 1);
2309 &derivativesO1_interp[0][1][0], 1, &tmp1[0], 1);
2312 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2314 else if (m_spacedim == 2)
2323 &Sgg[0][0], 1, &STx[0], 1);
2327 &Sxy[0], 1, &tmp1[0], 1);
2331 &derivativesO1_interp[0][2][0], 1, &tmp2[0], 1);
2334 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2335 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
2345 &Sgg[1][0], 1, &STy[0], 1);
2349 &Sxy[0], 1, &tmp1[0], 1);
2353 &derivativesO1_interp[1][2][0], 1, &tmp2[0], 1);
2356 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2357 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2359 else if (m_spacedim == 3)
2369 &Sgg[0][0], 1, &STx[0], 1);
2373 &Sxy[0], 1, &tmp1[0], 1);
2377 &Sxz[0], 1, &tmp2[0], 1);
2381 &derivativesO1_interp[0][3][0], 1, &tmp3[0], 1);
2384 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2385 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
2386 Vmath::Vadd(nPts, &STx[0], 1, &tmp3[0], 1, &STx[0], 1);
2397 &Sgg[1][0], 1, &STy[0], 1);
2401 &Sxy[0], 1, &tmp1[0], 1);
2405 &Syz[0], 1, &tmp2[0], 1);
2409 &derivativesO1_interp[1][3][0], 1, &tmp3[0], 1);
2412 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2413 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2414 Vmath::Vadd(nPts, &STy[0], 1, &tmp3[0], 1, &STy[0], 1);
2425 &Sgg[2][0], 1, &STz[0], 1);
2429 &Sxz[0], 1, &tmp1[0], 1);
2433 &Syz[0], 1, &tmp2[0], 1);
2437 &derivativesO1_interp[2][3][0], 1, &tmp3[0], 1);
2440 Vmath::Vadd(nPts, &STz[0], 1, &tmp1[0], 1, &STz[0], 1);
2441 Vmath::Vadd(nPts, &STz[0], 1, &tmp2[0], 1, &STz[0], 1);
2442 Vmath::Vadd(nPts, &STz[0], 1, &tmp3[0], 1, &STz[0], 1);
2450 int nq = physfield[0].num_elements();
2452 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2455 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2458 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][2][0], 1);
2463 int nq = physfield[0].num_elements();
2465 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2467 Vmath::Zero(nq, &viscousTensor_interp[1][0][0], 1);
2470 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2472 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[1][1][0], 1);
2475 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[0][2][0], 1);
2477 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor_interp[1][2][0], 1);
2480 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][3][0], 1);
2482 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor_interp[1][3][0], 1);
2487 int nq = physfield[0].num_elements();
2489 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2491 Vmath::Zero(nq, &viscousTensor_interp[1][0][0], 1);
2493 Vmath::Zero(nq, &viscousTensor_interp[2][0][0], 1);
2496 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2498 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[1][1][0], 1);
2500 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor_interp[2][1][0], 1);
2503 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[0][2][0], 1);
2505 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor_interp[1][2][0], 1);
2507 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor_interp[2][2][0], 1);
2510 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor_interp[0][3][0], 1);
2512 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor_interp[1][3][0], 1);
2514 Vmath::Vcopy(nPts, &Sgg[2][0], 1, &viscousTensor_interp[2][3][0], 1);
2517 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][4][0], 1);
2519 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor_interp[1][4][0], 1);
2521 Vmath::Vcopy(nPts, &STz[0], 1, &viscousTensor_interp[2][4][0], 1);
2526 ASSERTL0(
false,
"Illegal expansion dimension");
2532 for (j = 1; j < nVariables; ++j)
2535 m_fields[0]->PhysGalerkinProjection1DScaled(
2537 viscousTensor_interp[i][j],
2538 viscousTensor[i][j]);
2556 int nBCEdgePts = physfield[0].num_elements();
2560 Vmath::Vmul(nBCEdgePts, physfield[1], 1, physfield[1], 1, pressure, 1);
2563 Vmath::Vvtvp(nBCEdgePts, physfield[1+i], 1, physfield[1+i], 1,
2564 pressure, 1, pressure, 1);
2567 Vmath::Vdiv (nBCEdgePts, pressure, 1, physfield[0], 1, pressure, 1);
2570 pressure, 1, physfield[m_spacedim+1], 1, pressure, 1);
2589 Vmath::Vdiv(npts, pressure, 1, physfield[0], 1, enthalpy, 1);
2591 Vmath::Vadd(npts, tmp, 1, enthalpy, 1, enthalpy, 1);
2608 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
2609 const Array<OneD,
const Array<OneD, NekDouble> > &velocity,
2610 Array<OneD, NekDouble> &pressure)
2612 int nBCEdgePts = physfield[0].num_elements();
2616 Vmath::Vmul (nBCEdgePts, velocity[0], 1, physfield[1], 1, pressure, 1);
2619 Vmath::Vvtvp(nBCEdgePts, velocity[i], 1, physfield[1+i], 1,
2620 pressure, 1, pressure, 1);
2624 pressure, 1, physfield[m_spacedim+1], 1, pressure, 1);
2637 const Array<OneD, Array<OneD, NekDouble> > &physfield,
2638 Array<OneD, Array<OneD, NekDouble> > &velocity)
2640 const int nBCEdgePts = physfield[0].num_elements();
2644 Vmath::Vdiv(nBCEdgePts, physfield[1+i], 1, physfield[0], 1,
2657 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
2658 Array<OneD, NekDouble > &pressure,
2659 Array<OneD, NekDouble > &temperature)
2661 const int nq = physfield[0].num_elements();
2663 Vmath::Vdiv(nq, pressure, 1, physfield[0], 1, temperature, 1);
2675 const Array<OneD, Array<OneD, NekDouble> > &physfield,
2676 Array<OneD, NekDouble > &pressure,
2677 Array<OneD, NekDouble > &soundspeed)
2679 const int nq =
m_fields[0]->GetTotPoints();
2680 Vmath::Vdiv (nq, pressure, 1, physfield[0], 1, soundspeed, 1);
2693 Array<OneD, Array<OneD, NekDouble> > &physfield,
2694 Array<OneD, NekDouble > &soundspeed,
2695 Array<OneD, NekDouble > &mach)
2697 const int nq =
m_fields[0]->GetTotPoints();
2699 Vmath::Vmul(nq, physfield[1], 1, physfield[1], 1, mach, 1);
2707 Vmath::Vdiv(nq, mach, 1, physfield[0], 1, mach, 1);
2708 Vmath::Vdiv(nq, mach, 1, physfield[0], 1, mach, 1);
2724 const Array<OneD, const NekDouble> &temperature,
2725 Array<OneD, NekDouble> &mu)
2727 const int nPts = temperature.num_elements();
2732 for (
int i = 0; i < nPts; ++i)
2734 ratio = temperature[i] / T_star;
2735 mu[i] = mu_star * ratio * sqrt(ratio) *
2736 (T_star + 110.0) / (temperature[i] + 110.0);
2751 if (
m_comm->GetRank() == 0)
2753 cout <<
"Reached Steady State to tolerance "
2769 const int nFields =
m_fields.num_elements();
2772 Array<OneD, NekDouble> L2 (nFields);
2773 Array<OneD, NekDouble> residual(nFields);
2775 for (
int i = 0; i < nFields; ++i)
2777 Array<OneD, NekDouble> diff(nPoints);
2787 L2[0] = sqrt(residual[0]) /
m_rhoInf;
2789 for (
int i = 1; i < nFields-1; ++i)
2795 L2[nFields-1] = sqrt(residual[nFields-1]) / Einf;
2797 if (
m_comm->GetRank() == 0 && output)
2803 for (
int i = 0; i < nFields; ++i)
2805 m_errFile << setprecision(11) << setw(22) << scientific
2815 if (
m_session->DefinesCmdLineArgument(
"verbose") &&
2816 m_comm->GetRank() == 0 && output)
2818 cout <<
"-- Maximum L^2 residual: " << maxL2 << endl;
2833 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
2834 const Array<OneD, const NekDouble> &pressure,
2835 const Array<OneD, const NekDouble> &temperature,
2836 Array<OneD, NekDouble> &entropy)
2839 const int npts =
m_fields[0]->GetTotPoints();
2841 Array<OneD, NekDouble> L2entropy(npts, 0.0);
2843 for (
int i = 0; i <
npts; ++i)
2847 log(pressure[i] /
m_pInf);
2850 Vmath::Vmul(npts, entropy, 1, entropy, 1, L2entropy, 1);
2854 entropy_sum = sqrt(entropy_sum);
2856 std::ofstream m_file(
"L2entropy.txt", std::ios_base::app);
2858 m_file << setprecision(16) << scientific << entropy_sum << endl;
2868 const Array<OneD,
const Array<OneD, NekDouble> > &inarray)
2871 int nElements =
m_fields[0]->GetExpSize();
2874 Array<OneD, NekDouble> tstep (nElements, 0.0);
2875 Array<OneD, NekDouble> stdVelocity(nElements);
2886 for(n = 0; n < nElements; ++n)
2888 int npoints =
m_fields[0]->GetExp(n)->GetTotPoints();
2889 Array<OneD, NekDouble> one2D(npoints, 1.0);
2892 minLength = sqrt(Area);
2893 if (
m_fields[0]->GetExp(n)->as<LocalRegions::TriExp>())
2899 / (stdVelocity[n] * cLambda
2900 * (ExpOrder[n] - 1) * (ExpOrder[n] - 1));
2914 bool dumpInitialConditions,
2917 if (
m_session->DefinesParameter(
"SteadyStateTol"))
2919 const int nPoints =
m_fields[0]->GetTotPoints();
2920 m_un = Array<OneD, Array<OneD, NekDouble> > (
2923 for (
int i = 0; i <
m_fields.num_elements(); ++i)
2926 m_un[i] = Array<OneD, NekDouble>(nPoints);
2930 if (
m_comm->GetRank() == 0)
2932 std::string fName =
m_session->GetSessionName() +
2933 std::string(
".res");
2936 << setw(15) << left <<
"Time"
2937 << setw(22) << left <<
"rho";
2939 std::string velFields[3] = {
"u",
"v",
"w"};
2941 for (
int i = 0; i <
m_fields.num_elements()-2; ++i)
2943 m_errFile << setw(22) <<
"rho"+velFields[i];
2946 m_errFile << setw(22) << left <<
"E" << endl;
2960 const Array<OneD,
const Array<OneD, NekDouble> > &inarray,
2961 Array<OneD, NekDouble> &stdV)
2964 int n_element =
m_fields[0]->GetExpSize();
2968 Array<OneD, Array<OneD, NekDouble> > velocity (
m_spacedim);
2969 Array<OneD, Array<OneD, NekDouble> > stdVelocity(
m_spacedim);
2970 Array<OneD, NekDouble> pressure (nTotQuadPoints);
2971 Array<OneD, NekDouble> soundspeed (nTotQuadPoints);
2979 velocity [i] = Array<OneD, NekDouble>(nTotQuadPoints);
2980 stdVelocity[i] = Array<OneD, NekDouble>(nTotQuadPoints, 0.0);
2987 for(
int el = 0; el < n_element; ++el)
2989 ptsKeys =
m_fields[0]->GetExp(el)->GetPointsKeys();
2993 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo();
2994 const Array<TwoD, const NekDouble> &gmat =
2995 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()
2996 ->GetDerivFactors(ptsKeys);
2998 int nq =
m_fields[0]->GetExp(el)->GetTotPoints();
3010 1, stdVelocity[i], 1, stdVelocity[i], 1);
3023 1, stdVelocity[i], 1, stdVelocity[i], 1);
3028 for (
int i = 0; i < nq; ++i)
3033 pntVelocity += stdVelocity[j][i]*stdVelocity[j][i];
3035 pntVelocity = sqrt(pntVelocity) + soundspeed[nBCEdgePts];
3036 if (pntVelocity > stdV[el])
3038 stdV[el] = pntVelocity;
3054 ASSERTL0(n <= 20,
"Illegal modes dimension for CFL calculation "
3055 "(P has to be less then 20)");
3057 NekDouble CFLDG[21] = { 2.0000, 6.0000, 11.8424, 19.1569,
3058 27.8419, 37.8247, 49.0518, 61.4815,
3059 75.0797, 89.8181, 105.6700, 122.6200,
3060 140.6400, 159.7300, 179.8500, 201.0100,
3061 223.1800, 246.3600, 270.5300, 295.6900,
3071 ASSERTL0(
false,
"Continuous Galerkin stability coefficients "
3072 "not introduced yet.");
3086 const Array<OneD,int> &ExpOrder)
3090 for (i =0; i<
m_fields[0]->GetExpSize(); i++)
3098 const Array<OneD,
const Array<OneD, NekDouble> > &physarray,
3099 Array<OneD, NekDouble> &Sensor,
3100 Array<OneD, NekDouble> &SensorKappa)
3102 int e, NumModesElement, nQuadPointsElement;
3104 int nElements =
m_fields[0]->GetExpSize();
3111 Array<OneD, NekDouble> SolP (nTotQuadPoints, 0.0);
3112 Array<OneD, NekDouble> SolPmOne(nTotQuadPoints, 0.0);
3113 Array<OneD, NekDouble> SolNorm (nTotQuadPoints, 0.0);
3115 Vmath::Vcopy(nTotQuadPoints, physarray[0], 1, SolP, 1);
3117 int CoeffsCount = 0;
3119 for (e = 0; e < nElements; e++)
3121 NumModesElement = ExpOrderElement[e];
3122 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3123 int nCoeffsElement =
m_fields[0]->GetExp(e)->GetNcoeffs();
3124 int numCutOff = NumModesElement - 1;
3129 Array<OneD, NekDouble> SolPElementPhys (nQuadPointsElement, 0.0);
3130 Array<OneD, NekDouble> SolPElementCoeffs(nCoeffsElement, 0.0);
3132 Array<OneD, NekDouble> SolPmOneElementPhys(nQuadPointsElement, 0.0);
3133 Array<OneD, NekDouble> SolPmOneElementCoeffs(nCoeffsElement, 0.0);
3137 for (
int i = 0; i < nQuadPointsElement; i++)
3139 SolPElementPhys[i] = SolP[CoeffsCount+i];
3142 m_fields[0]->GetExp(e)->FwdTrans(SolPElementPhys,
3150 m_fields[0]->GetExp(e)->ReduceOrderCoeffs(numCutOff,
3152 SolPmOneElementCoeffs);
3154 m_fields[0]->GetExp(e)->BwdTrans(SolPmOneElementCoeffs,
3155 SolPmOneElementPhys);
3157 for (
int i = 0; i < nQuadPointsElement; i++)
3159 SolPmOne[CoeffsCount+i] = SolPmOneElementPhys[i];
3169 SolPmOneElementPhys, 1,
3177 for (
int i = 0; i < nQuadPointsElement; i++)
3179 SolPmeanNumerator += SolNorm[i];
3180 SolPmeanDenumerator += SolPElementPhys[i];
3183 for (
int i = 0; i < nQuadPointsElement; ++i)
3185 Sensor[CoeffsCount+i] =
3186 sqrt(SolPmeanNumerator / nQuadPointsElement) /
3187 sqrt(SolPmeanDenumerator / nQuadPointsElement);
3189 Sensor[CoeffsCount+i] = log10(Sensor[CoeffsCount+i]);
3191 CoeffsCount += nQuadPointsElement;
3196 for (e = 0; e < nElements; e++)
3198 NumModesElement = ExpOrderElement[e];
3202 nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3204 for (
int i = 0; i < nQuadPointsElement; i++)
3206 if (Sensor[CoeffsCount+i] <= (Phi0 - DeltaPhi))
3208 SensorKappa[CoeffsCount+i] = 0;
3210 else if(Sensor[CoeffsCount+i] >= (Phi0 + DeltaPhi))
3212 SensorKappa[CoeffsCount+i] = ThetaS;
3214 else if(abs(Sensor[CoeffsCount+i]-Phi0) < DeltaPhi)
3216 SensorKappa[CoeffsCount+i] =
3217 ThetaS / 2 * (1 + sin(M_PI * (Sensor[CoeffsCount+i] -
3218 Phi0) / (2 * DeltaPhi)));
3222 CoeffsCount += nQuadPointsElement;
3228 const Array<OneD,
const Array<OneD, NekDouble> > &inarray,
3229 Array<OneD, Array<OneD, NekDouble> > outarrayForcing)
3231 const int nPts =
m_fields[0]->GetTotPoints();
3232 const int nvariables =
m_fields.num_elements();
3233 const int nElements =
m_fields[0]->GetExpSize();
3235 Array<OneD, NekDouble> Sensor(nPts, 0.0);
3236 Array<OneD, NekDouble> SensorKappa(nPts, 0.0);
3237 Array <OneD, NekDouble > Lambda(nPts, 0.0);
3238 Array <OneD, NekDouble >
Tau(nPts, 1.0);
3239 Array <OneD, NekDouble > soundspeed(nPts, 0.0);
3240 Array <OneD, NekDouble > pressure(nPts, 0.0);
3241 Array <OneD, NekDouble > temperature(nPts, 0.0);
3242 Array <OneD, NekDouble > absVelocity(nPts, 0.0);
3243 Array <OneD, NekDouble > hel(nPts, 0.0);
3244 Array <OneD, NekDouble > h_minmin(m_spacedim, 0.0);
3247 Array<OneD, NekDouble> pOrder (nPts, 0.0);
3254 GetSensor(inarray, Sensor, SensorKappa);
3257 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
3263 for (
int e = 0; e < nElements; e++)
3265 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3267 for (
int n = 0; n < nQuadPointsElement; n++)
3269 pOrder[n + PointCount] = pOrderElmt[e];
3272 Tau[n + PointCount] =
3273 1.0 / (
m_C1*pOrder[n + PointCount]*LambdaMax);
3275 outarrayForcing[nvariables-1][n + PointCount] =
3277 pOrder[n + PointCount] *
3278 SensorKappa[n + PointCount] -
3279 inarray[nvariables-1][n + PointCount]);
3281 PointCount += nQuadPointsElement;
3286 Array<OneD, Array<OneD, NekDouble> > &outarray,
3287 Array<OneD, NekDouble > &hmin)
3290 const int nElements =
m_fields[0]->GetExpSize();
3297 for (
int e = 0; e < nElements; e++)
3300 Array <OneD, NekDouble> L1(nedges, 0.0);
3302 for (
int j = 0; j < nedges; ++j)
3313 if (boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3314 m_fields[0]->GetExp(e)->GetGeom()))
3317 boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3318 m_fields[0]->GetExp(e)->GetGeom());
3320 ElQuadGeom->GetEdge(j)->GetVertex(0)->GetCoords(x0, y0, z0);
3321 ElQuadGeom->GetEdge(j)->GetVertex(1)->GetCoords(x1, y1, z1);
3323 L1[j] = sqrt(pow((x0-x1),2)+pow((y0-y1),2)+pow((z0-z1),2));
3327 ASSERTL0(
false,
"GetElementDimensions() is only "
3328 "implemented for quadrilateral elements");
3334 if(boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3335 m_fields[0]->GetExp(e)->GetGeom()))
3337 hx = min(L1[0], L1[2]);
3338 hy = min(L1[1], L1[3]);
3340 outarray[0][e] = hx;
3341 outarray[1][e] = hy;
3345 hmin[0] =
Vmath::Vmin(outarray[0].num_elements(), outarray[0], 1);
3346 hmin[1] =
Vmath::Vmin(outarray[1].num_elements(), outarray[1], 1);
3350 const Array<OneD,
const Array<OneD, NekDouble> > &inarray,
3351 Array<OneD, NekDouble> &Vtot)
3356 Array<OneD, Array<OneD, NekDouble> > velocity (m_spacedim);
3362 velocity[i] = Array<OneD, NekDouble>(nTotQuadPoints);
3380 const Array<OneD, Array<OneD, NekDouble> > &physfield,
3381 Array<OneD, NekDouble > &eps_bar)
3383 int nvariables = physfield.num_elements();
3384 int nPts =
m_fields[0]->GetTotPoints();
3386 Array<OneD, NekDouble > pressure (nPts, 0.0);
3387 Array<OneD, NekDouble > temperature(nPts, 0.0);
3388 Array<OneD, NekDouble > sensor (nPts, 0.0);
3389 Array<OneD, NekDouble > SensorKappa(nPts, 0.0);
3390 Array<OneD, NekDouble > absVelocity(nPts, 0.0);
3391 Array<OneD, NekDouble > soundspeed (nPts, 0.0);
3392 Array<OneD, NekDouble > Lambda (nPts, 0.0);
3393 Array<OneD, NekDouble > mu_var (nPts, 0.0);
3394 Array<OneD, NekDouble > h_minmin (m_spacedim, 0.0);
3402 GetSensor(physfield, sensor, SensorKappa);
3405 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
3423 for (
int e = 0; e < eps_bar.num_elements(); e++)
3425 if (physfield[nvariables-1][e] <= (Phi0 - DeltaPhi))
3429 else if(physfield[nvariables-1][e] >= (Phi0 + DeltaPhi))
3433 else if(abs(physfield[nvariables-1][e]-Phi0) < DeltaPhi)
3435 eps_bar[e] =
m_mu0/2*(1+sin(M_PI*
3436 (physfield[nvariables-1][e]-Phi0)/(2*DeltaPhi)));
3443 const Array<OneD, Array<OneD, NekDouble> > &physfield,
3444 Array<OneD, NekDouble > &mu_var)
3446 const int nElements =
m_fields[0]->GetExpSize();
3450 Array<OneD, NekDouble> S_e (nTotQuadPoints, 0.0);
3451 Array<OneD, NekDouble> se (nTotQuadPoints, 0.0);
3452 Array<OneD, NekDouble> Sensor (nTotQuadPoints, 0.0);
3453 Array<OneD, NekDouble> SensorKappa(nTotQuadPoints, 0.0);
3454 Array<OneD, NekDouble> absVelocity(nTotQuadPoints, 0.0);
3455 Array<OneD, NekDouble> soundspeed (nTotQuadPoints, 0.0);
3456 Array<OneD, NekDouble> pressure (nTotQuadPoints, 0.0);
3461 GetSensor (physfield, Sensor, SensorKappa);
3464 Array<OneD, NekDouble> Lambda(nTotQuadPoints, 1.0);
3465 Vmath::Vadd(nTotQuadPoints, absVelocity, 1, soundspeed, 1, Lambda, 1);
3467 for (
int e = 0; e < nElements; e++)
3478 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3479 Array <OneD, NekDouble> one2D(nQuadPointsElement, 1.0);
3481 for (
int n = 0; n < nQuadPointsElement; n++)
3487 mu_var[n+PointCount] = 0;
3492 mu_var[n+PointCount] = mu_0 * (0.5 * (1 + sin(
3493 M_PI * (Sensor[n+PointCount] -
3499 mu_var[n+PointCount] = mu_0;
3503 PointCount += nQuadPointsElement;
3508 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
3509 Array<OneD, NekDouble > &PolyOrder)
3514 int nElements =
m_fields[0]->GetExpSize();
3515 int npts =
m_fields[0]->GetTotPoints();
3517 Array<OneD, NekDouble > Sensor (npts, 0.0);
3518 Array<OneD, NekDouble > SensorKappa(npts, 0.0);
3519 Array<OneD, NekDouble > se (npts, 0.0);
3521 GetSensor(physfield, Sensor, SensorKappa);
3523 int nQuadPointsElement = 0;
3527 int MinOrderShock = 4;
3529 std::ofstream m_file(
"VariablePComposites.txt", std::ios_base::app);
3530 for (
int e = 0; e < nElements; e++)
3532 m_file <<
"<C ID=\"" << e+1 <<
"\"> Q[" << e <<
"] </C>"<< endl;
3536 std::ofstream m_file2(
"VariablePExpansions.txt", std::ios_base::app);
3538 for (e = 0; e < nElements; e++)
3540 nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3551 for (
int i = 0; i < nQuadPointsElement; i++)
3553 se[npCount + i] = (Sensor[npCount + i]);
3555 if (se[npCount + i] > s_ds)
3557 if (PolyOrder[npCount + i] > MinOrderShock)
3559 PolyOrder[npCount + i] = PolyOrder[npCount + i] - 1;
3561 else if(PolyOrder[e] < MinOrderShock)
3563 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 1;
3567 else if (se[npCount + i] > s_sm && se[npCount + i] < s_ds)
3569 if (PolyOrder[npCount + i] < MaxOrder)
3571 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 2;
3574 else if (se[npCount + i] > s_fl && se[npCount + i] < s_sm)
3576 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 1;
3578 else if (se[npCount + i] < s_fl)
3580 if (PolyOrder[npCount + i] > MinOrder)
3582 PolyOrder[npCount + i] = PolyOrder[npCount + i];
3586 m_file2 <<
"<E COMPOSITE= \"C[" << e+1
3587 <<
"]\" NUMMODES=\"" << PolyOrder[npCount + 1]
3588 <<
"\" TYPE=\"MODIFIED\" FIELDS=\"rho,rhou,rhov,rhow,E\" />"
3590 npCount += nQuadPointsElement;
3597 std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
3598 std::vector<std::string> &variables)
3600 const int nPhys =
m_fields[0]->GetNpoints();
3601 const int nCoeffs =
m_fields[0]->GetNcoeffs();
3602 Array<OneD, Array<OneD, NekDouble> > tmp(
m_fields.num_elements());
3604 for (
int i = 0; i <
m_fields.num_elements(); ++i)
3609 Array<OneD, NekDouble> pressure(nPhys), soundspeed(nPhys), mach(nPhys);
3610 Array<OneD, NekDouble> sensor(nPhys), SensorKappa(nPhys), smooth(nPhys);
3614 GetMach (tmp, soundspeed, mach);
3618 Array<OneD, NekDouble> pFwd(nCoeffs), sFwd(nCoeffs), mFwd(nCoeffs);
3619 Array<OneD, NekDouble> sensFwd(nCoeffs), smoothFwd(nCoeffs);
3621 m_fields[0]->FwdTrans(pressure, pFwd);
3622 m_fields[0]->FwdTrans(soundspeed, sFwd);
3624 m_fields[0]->FwdTrans(sensor, sensFwd);
3625 m_fields[0]->FwdTrans(smooth, smoothFwd);
3627 variables.push_back (
"p");
3628 variables.push_back (
"a");
3629 variables.push_back (
"Mach");
3630 variables.push_back (
"Sensor");
3631 variables.push_back (
"SmoothVisc");
3632 fieldcoeffs.push_back(pFwd);
3633 fieldcoeffs.push_back(sFwd);
3634 fieldcoeffs.push_back(mFwd);
3635 fieldcoeffs.push_back(sensFwd);
3636 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)
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
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)
Base class for unsteady solvers.
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.
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Init object for UnsteadySystem class.
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)
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)
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.
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.