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,
333 int nvariables =
m_fields.num_elements();
335 if(!userDefStr.empty())
337 if(boost::iequals(userDefStr,
"Wall"))
339 WallBC(n, cnt, Fwd, inarray);
341 else if(boost::iequals(userDefStr,
"WallViscous") ||
342 boost::iequals(userDefStr,
"WallAdiabatic"))
347 else if(boost::iequals(userDefStr,
"Symmetry"))
352 else if(boost::iequals(userDefStr,
"RiemannInvariant"))
357 else if(boost::iequals(userDefStr,
"PressureOutflowNonReflective"))
362 else if(boost::iequals(userDefStr,
"PressureOutflow"))
367 else if(boost::iequals(userDefStr,
"PressureOutflowFile"))
372 else if(boost::iequals(userDefStr,
"PressureInflowFile"))
377 else if(boost::iequals(userDefStr,
"ExtrapOrder0"))
382 else if(boost::iequals(userDefStr,
"TimeDependent"))
384 for (
int i = 0; i < nvariables; ++i)
387 m_fields[i]->EvaluateBoundaryConditions(time, varName);
392 string errmsg =
"Unrecognised boundary condition: ";
393 errmsg += userDefStr;
409 int nVariables = physarray.num_elements();
416 int e, id1, id2, nBCEdgePts, eMax;
418 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
420 for (e = 0; e < eMax; ++e)
422 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
423 GetExp(e)->GetTotPoints();
424 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
426 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
437 &Fwd[nVariables-1][id2], 1,
441 &Fwd[nVariables-1][id2], 1,
443 &Fwd[nVariables-1][id2], 1);
447 &Fwd[nVariables-1][id2], 1,
448 &Fwd[nVariables-1][id2], 1);
466 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
479 for (i = 0; i < nVariables; ++i)
482 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
483 UpdatePhys())[id1], 1);
498 int nVariables = physarray.num_elements();
506 int e, id1, id2, nBCEdgePts, eMax;
508 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
510 for (e = 0; e < eMax; ++e)
512 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
513 GetExp(e)->GetTotPoints();
514 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
516 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
526 &Fwd[nVariables-1][id2], 1,
530 &Fwd[nVariables-1][id2], 1,
532 &Fwd[nVariables-1][id2], 1);
536 &Fwd[nVariables-1][id2], 1,
537 &Fwd[nVariables-1][id2], 1);
546 for (i = 0; i < nVariables; ++i)
549 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
550 UpdatePhys())[id1], 1);
565 int nVariables = physarray.num_elements();
572 int e, id1, id2, nBCEdgePts, eMax;
574 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
576 for (e = 0; e < eMax; ++e)
578 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
579 GetExp(e)->GetTotPoints();
580 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
582 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
592 &Fwd[nVariables-1][id2], 1,
596 &Fwd[nVariables-1][id2], 1,
598 &Fwd[nVariables-1][id2], 1);
602 &Fwd[nVariables-1][id2], 1,
603 &Fwd[nVariables-1][id2], 1);
620 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
633 for (i = 0; i < nVariables; ++i)
636 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->
637 UpdatePhys())[id1], 1);
662 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
673 if (nDimensions == 2 || nDimensions == 3)
677 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
679 if (nDimensions == 3)
683 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
690 for (i = 0; i < nDimensions; ++i)
692 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
699 for (i = 0; i < nDimensions; ++i)
701 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
703 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
711 for (i = 0; i < nTracePts; i++)
715 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
716 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
720 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
721 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
722 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
726 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
727 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
728 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
729 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
732 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
737 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
742 int e, id1, id2, nBCEdgePts, pnt;
743 NekDouble cPlus, rPlus, cMinus, rMinus, VDBC, VNBC;
748 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
751 for (e = 0; e < eMax; ++e)
753 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
754 GetExp(e)->GetTotPoints();
756 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
758 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
761 for (i = 0; i < nBCEdgePts; i++)
769 if (Mach[pnt] < 1.00)
772 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
773 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
777 rMinus = VnInf[pnt] - 2.0 * cMinus * gammaMinusOneInv;
783 rPlus = VnInf[pnt] + 2.0 * cPlus * gammaMinusOneInv;
787 rMinus = VnInf[pnt] - 2.0 * cPlus * gammaMinusOneInv;
791 VNBC = 0.5 * (rPlus + rMinus);
792 cBC = 0.25 * gammaMinusOne * (rPlus - rMinus);
793 VDBC = VNBC - VnInf[pnt];
797 rhoBC = pow((cBC * cBC) / (gamma * sBC), gammaMinusOneInv);
798 pBC = rhoBC * cBC * cBC * gammaInv;
804 for ( j = 0; j < nDimensions; ++j)
807 rhoVelBC[j] = rhoBC * velBC[j];
808 EkBC += 0.5 * rhoBC * velBC[j]*velBC[j];
812 EBC = pBC * gammaMinusOneInv + EkBC;
815 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
816 UpdatePhys())[id1+i] = rhoBC;
817 for (j = 0; j < nDimensions; ++j)
819 (
m_fields[j+1]->GetBndCondExpansions()[bcRegion]->
820 UpdatePhys())[id1+i] = rhoVelBC[j];
822 (
m_fields[nDimensions+1]->GetBndCondExpansions()[bcRegion]->
823 UpdatePhys())[id1+i] = EBC;
829 if (Mach[pnt] < 1.00)
832 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
833 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
837 rMinus = VnInf[pnt] - 2.0 * cMinus * gammaMinusOneInv;
842 cPlus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
843 rPlus = Vn[pnt] + 2.0 * cPlus * gammaMinusOneInv;
846 cMinus = sqrt(gamma * pressure[pnt] / Fwd[0][pnt]);
847 rMinus = Vn[pnt] - 2.0 * cPlus * gammaMinusOneInv;
851 VNBC = 0.5 * (rPlus + rMinus);
852 cBC = 0.25 * gammaMinusOne * (rPlus - rMinus);
853 VDBC = VNBC - Vn[pnt];
856 sBC = pressure[pnt] / (pow(Fwd[0][pnt], gamma));
857 rhoBC = pow((cBC * cBC) / (gamma * sBC), gammaMinusOneInv);
858 pBC = rhoBC * cBC * cBC * gammaInv;
864 for ( j = 0; j < nDimensions; ++j)
866 velBC[j] = Fwd[j+1][pnt] / Fwd[0][pnt] +
868 rhoVelBC[j] = rhoBC * velBC[j];
869 EkBC += 0.5 * rhoBC * velBC[j]*velBC[j];
873 EBC = pBC * gammaMinusOneInv + EkBC;
876 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
877 UpdatePhys())[id1+i] = rhoBC;
878 for (j = 0; j < nDimensions; ++j)
880 (
m_fields[j+1]->GetBndCondExpansions()[bcRegion]->
881 UpdatePhys())[id1+i] = rhoVelBC[j];
883 (
m_fields[nDimensions+1]->GetBndCondExpansions()[bcRegion]->
884 UpdatePhys())[id1+i] = EBC;
903 int nVariables = physarray.num_elements();
911 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
922 if (nDimensions == 2 || nDimensions == 3)
926 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
928 if (nDimensions == 3)
932 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
939 for (i = 0; i < nDimensions; ++i)
941 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
948 for (i = 0; i < nDimensions; ++i)
950 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
952 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
960 for (i = 0; i < nTracePts; i++)
964 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
965 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
969 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
970 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
971 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
975 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
976 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
977 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
978 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
981 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
986 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
990 int e, id1, id2,
npts, pnt;
994 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
997 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
998 GetExp(e)->GetTotPoints();
999 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1001 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1004 for (i = 0; i <
npts; i++)
1009 if (Mach[pnt] < 0.99)
1013 for (j = 1; j < nVariables-1; ++j)
1015 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1018 rhoeb =
m_pInf * gammaMinusOneInv + Ek;
1021 for (j = 0; j < nVariables-1; ++j)
1023 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1024 UpdatePhys())[id1+i] = Fwd[j][pnt];
1027 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1028 UpdatePhys())[id1+i] = 2.0 * rhoeb - Fwd[nVariables-1][pnt];
1033 for (j = 0; j < nVariables; ++j)
1036 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1037 UpdatePhys())[id1+i] = Fwd[j][pnt];
1056 int nVariables = physarray.num_elements();
1064 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1075 if (nDimensions == 2 || nDimensions == 3)
1079 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1081 if (nDimensions == 3)
1085 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1092 for (i = 0; i < nDimensions; ++i)
1094 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1101 for (i = 0; i < nDimensions; ++i)
1103 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1104 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1105 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1113 for (i = 0; i < nTracePts; i++)
1117 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1118 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1122 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1123 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1124 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1128 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1129 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1130 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1131 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1134 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1139 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1143 int e, id1, id2,
npts, pnt;
1147 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1150 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1151 GetExp(e)->GetTotPoints();
1152 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1154 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1157 for (i = 0; i <
npts; i++)
1162 if (Mach[pnt] < 0.99)
1166 for (j = 1; j < nVariables-1; ++j)
1168 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1171 rhoeb =
m_pInf * gammaMinusOneInv + Ek;
1174 for (j = 0; j < nVariables-1; ++j)
1176 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1177 UpdatePhys())[id1+i] = Fwd[j][pnt];
1180 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1181 UpdatePhys())[id1+i] = rhoeb;
1186 for (j = 0; j < nVariables; ++j)
1189 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1190 UpdatePhys())[id1+i] = Fwd[j][pnt];
1210 int nVariables = physarray.num_elements();
1218 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1229 if (nDimensions == 2 || nDimensions == 3)
1233 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1235 if (nDimensions == 3)
1239 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1246 for (i = 0; i < nDimensions; ++i)
1248 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1255 for (i = 0; i < nDimensions; ++i)
1257 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1258 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1259 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1267 for (i = 0; i < nTracePts; i++)
1271 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1272 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1276 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1277 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1278 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1282 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1283 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1284 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1285 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1288 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1293 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1297 int e, id1, id2,
npts, pnt;
1301 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1304 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1305 GetExp(e)->GetTotPoints();
1306 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1308 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1311 for (i = 0; i <
npts; i++)
1316 if (Mach[pnt] < 0.99)
1320 for (j = 1; j < nVariables-1; ++j)
1322 Ek += 0.5 * (Fwd[j][pnt] * Fwd[j][pnt]) / Fwd[0][pnt];
1328 for (j = 0; j < nVariables-1; ++j)
1330 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1331 UpdatePhys())[id1+i] = Fwd[j][pnt];
1334 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1335 UpdatePhys())[id1+i] = rhoeb;
1340 for (j = 0; j < nVariables; ++j)
1343 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1344 UpdatePhys())[id1+i] = Fwd[j][pnt];
1366 int nVariables = physarray.num_elements();
1374 NekDouble gammaMinusOneInv = 1.0 / gammaMinusOne;
1385 if (nDimensions == 2 || nDimensions == 3)
1389 Vmath::Vadd(nTracePts, VnInf, 1, tmp1, 1, VnInf, 1);
1391 if (nDimensions == 3)
1395 Vmath::Vadd(nTracePts, VnInf, 1, tmp2, 1, VnInf, 1);
1402 for (i = 0; i < nDimensions; ++i)
1404 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, Vel, 1);
1411 for (i = 0; i < nDimensions; ++i)
1413 Vmath::Vdiv(nTracePts, Fwd[i+1], 1, Fwd[0], 1, tmp1, 1);
1414 Vmath::Vmul(nTracePts, tmp1, 1, tmp1, 1, tmp1, 1);
1415 Vmath::Vadd(nTracePts, tmp1, 1, absVel, 1, absVel, 1);
1423 for (i = 0; i < nTracePts; i++)
1427 pressure[i] = (gammaMinusOne) * (Fwd[2][i] -
1428 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i]));
1432 pressure[i] = (gammaMinusOne) * (Fwd[3][i] -
1433 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1434 Fwd[2][i] * Fwd[2][i] / Fwd[0][i]));
1438 pressure[i] = (gammaMinusOne) * (Fwd[4][i] -
1439 0.5 * (Fwd[1][i] * Fwd[1][i] / Fwd[0][i] +
1440 Fwd[2][i] * Fwd[2][i] / Fwd[0][i] +
1441 Fwd[3][i] * Fwd[3][i] / Fwd[0][i]));
1444 soundSpeed[i] = sqrt(gamma * pressure[i] / Fwd[0][i]);
1449 Vmath::Vdiv(nTracePts, Vn, 1, soundSpeed, 1, Mach, 1);
1453 int e, id1, id2,
npts, pnt;
1457 for (e = 0; e <
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1460 npts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1461 GetExp(e)->GetTotPoints();
1462 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1464 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1467 for (i = 0; i <
npts; i++)
1472 if (Mach[pnt] < 0.99)
1475 for (j = 0; j < nVariables-1; ++j)
1477 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1483 for (j = 1; j < nVariables-1; ++j)
1489 rhoeb = gammaMinusOneInv * pressure[pnt] + Ek;
1491 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1492 UpdatePhys())[id1+i] = rhoeb;
1497 for (j = 0; j < nVariables; ++j)
1500 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1501 UpdatePhys())[id1+i] = Fwd[j][pnt];
1521 int id1, id2, nBCEdgePts;
1522 int nVariables = physarray.num_elements();
1530 eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
1533 for (e = 0; e < eMax; ++e)
1535 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1536 GetExp(e)->GetTotPoints();
1537 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1539 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
1542 for (i = 0; i < nBCEdgePts; i++)
1547 (
m_fields[0]->GetBndCondExpansions()[bcRegion]->
1548 UpdatePhys())[id1+i] = Fwd[0][pnt];
1551 for (j = 1; j <=nDimensions; ++j)
1553 (
m_fields[j]->GetBndCondExpansions()[bcRegion]->
1554 UpdatePhys())[id1+i] = Fwd[j][pnt];
1558 (
m_fields[nVariables-1]->GetBndCondExpansions()[bcRegion]->
1559 UpdatePhys())[id1+i] = Fwd[nVariables-1][pnt];
1576 int nq = physfield[0].num_elements();
1577 int nVariables =
m_fields.num_elements();
1597 Vmath::Vmul(nq, velocity[j], 1, physfield[i+1], 1,
1602 Vmath::Vadd(nq, flux[i+1][i], 1, pressure, 1, flux[i+1][i], 1);
1606 Vmath::Vadd(nq, physfield[m_spacedim+1], 1, pressure, 1,
1612 flux[m_spacedim+1][j], 1);
1616 if (nVariables == m_spacedim+3)
1639 int nq = physfield[0].num_elements();
1640 int nVariables =
m_fields.num_elements();
1644 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
1653 for (i = 0; i < nVariables; ++ i)
1658 OneDptscale, physfield[i], physfield_interp[i]);
1672 m_fields[0]->PhysGalerkinProjection1DScaled(
1673 OneDptscale, physfield_interp[i+1], flux[0][i]);
1677 GetPressure (physfield_interp, velocity, pressure);
1684 Vmath::Vmul(nq, velocity[j], 1, physfield_interp[i+1], 1,
1685 flux_interp[i+1][j], 1);
1689 Vmath::Vadd(nq, flux_interp[i+1][i], 1, pressure,1,
1690 flux_interp[i+1][i], 1);
1698 m_fields[0]->PhysGalerkinProjection1DScaled(
1699 OneDptscale, flux_interp[i+1][j], flux[i+1][j]);
1704 Vmath::Vadd(nq, physfield_interp[m_spacedim+1], 1, pressure, 1,
1710 flux_interp[m_spacedim+1][j], 1);
1713 m_fields[0]->PhysGalerkinProjection1DScaled(
1715 flux_interp[m_spacedim+1][j],
1716 flux[m_spacedim+1][j]);
1731 int nVariables =
m_fields.num_elements();
1732 int nPts = physfield[0].num_elements();
1748 Vmath::Smul(nPts, tRa, &mu[0], 1, &thermalConductivity[0], 1);
1754 &thermalConductivity[0], 1);
1767 Vmath::Vadd(nPts, &divVel[0], 1, &derivativesO1[j][j][0], 1,
1772 Vmath::Smul(nPts, lambda, &divVel[0], 1, &divVel[0], 1);
1773 Vmath::Vmul(nPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
1782 Vmath::Vmul(nPts, &mu2[0], 1, &derivativesO1[j][j][0], 1,
1785 Vmath::Vadd(nPts, &tmp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
1794 if (m_spacedim == 2)
1798 &derivativesO1[1][0][0], 1, &Sxy[0], 1);
1801 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
1803 else if (m_spacedim == 3)
1807 &derivativesO1[1][0][0], 1, &Sxy[0], 1);
1811 &derivativesO1[2][0][0], 1, &Sxz[0], 1);
1815 &derivativesO1[2][1][0], 1, &Syz[0], 1);
1818 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
1821 Vmath::Vmul(nPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
1824 Vmath::Vmul(nPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
1840 if (m_spacedim == 1)
1845 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1849 &derivativesO1[0][1][0], 1, &tmp1[0], 1);
1852 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1854 else if (m_spacedim == 2)
1862 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1865 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1869 &derivativesO1[0][2][0], 1, &tmp2[0], 1);
1872 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1873 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
1882 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sgg[1][0], 1, &STy[0], 1);
1885 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1889 &derivativesO1[1][2][0], 1, &tmp2[0], 1);
1892 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
1893 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
1895 else if (m_spacedim == 3)
1904 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sgg[0][0], 1, &STx[0], 1);
1907 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1910 Vmath::Vmul(nPts, &physfield[2][0], 1, &Sxz[0], 1, &tmp2[0], 1);
1914 &derivativesO1[0][3][0], 1, &tmp3[0], 1);
1917 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
1918 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
1919 Vmath::Vadd(nPts, &STx[0], 1, &tmp3[0], 1, &STx[0], 1);
1929 Vmath::Vmul(nPts, &physfield[1][0], 1, &Sgg[1][0], 1, &STy[0], 1);
1932 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxy[0], 1, &tmp1[0], 1);
1935 Vmath::Vmul(nPts, &physfield[2][0], 1, &Syz[0], 1, &tmp2[0], 1);
1939 &derivativesO1[1][3][0], 1, &tmp3[0], 1);
1942 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
1943 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
1944 Vmath::Vadd(nPts, &STy[0], 1, &tmp3[0], 1, &STy[0], 1);
1954 Vmath::Vmul(nPts, &physfield[2][0], 1, &Sgg[2][0], 1, &STz[0], 1);
1957 Vmath::Vmul(nPts, &physfield[0][0], 1, &Sxz[0], 1, &tmp1[0], 1);
1960 Vmath::Vmul(nPts, &physfield[1][0], 1, &Syz[0], 1, &tmp2[0], 1);
1964 &derivativesO1[2][3][0], 1, &tmp3[0], 1);
1967 Vmath::Vadd(nPts, &STz[0], 1, &tmp1[0], 1, &STz[0], 1);
1968 Vmath::Vadd(nPts, &STz[0], 1, &tmp2[0], 1, &STz[0], 1);
1969 Vmath::Vadd(nPts, &STz[0], 1, &tmp3[0], 1, &STz[0], 1);
1980 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
1983 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][2][0], 1);
1994 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
1996 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[1][1][0], 1);
1999 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[0][2][0], 1);
2001 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor[1][2][0], 1);
2004 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][3][0], 1);
2006 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor[1][3][0], 1);
2019 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor[0][1][0], 1);
2021 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[1][1][0], 1);
2023 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor[2][1][0], 1);
2026 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor[0][2][0], 1);
2028 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor[1][2][0], 1);
2030 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor[2][2][0], 1);
2033 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor[0][3][0], 1);
2035 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor[1][3][0], 1);
2037 Vmath::Vcopy(nPts, &Sgg[2][0], 1, &viscousTensor[2][3][0], 1);
2040 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor[0][4][0], 1);
2042 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor[1][4][0], 1);
2044 Vmath::Vcopy(nPts, &STz[0], 1, &viscousTensor[2][4][0], 1);
2049 ASSERTL0(
false,
"Illegal expansion dimension");
2065 int nVariables =
m_fields.num_elements();
2066 int nPts = physfield[0].num_elements();
2068 int variables_phys = physfield.num_elements();
2074 nPts =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
2076 int nVariables_aux = derivativesO1[0].num_elements();
2088 for (j = 0; j < nVariables; ++j)
2104 for (i = 0; i < nVariables; ++i)
2107 OneDptscale, physfield[i], fields_interp[i]);
2110 for (i = 0; i < variables_phys; ++i)
2115 m_fields[0]->PhysInterp1DScaled(OneDptscale, physfield[i],
2116 physfield_interp[i]);
2123 for (j = 0; j < nVariables_aux; ++j)
2127 OneDptscale, derivativesO1[i][j],
2128 derivativesO1_interp[i][j]);
2156 Vmath::Vadd(nPts, &divVel[0], 1, &derivativesO1_interp[j][j][0], 1,
2161 Vmath::Smul(nPts, lambda, &divVel[0], 1, &divVel[0], 1);
2162 Vmath::Vmul(nPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
2171 Vmath::Vmul(nPts, &mu2[0], 1, &derivativesO1_interp[j][j][0], 1,
2174 Vmath::Vadd(nPts, &tmp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
2183 if (m_spacedim == 2)
2186 Vmath::Vadd(nPts, &derivativesO1_interp[0][1][0], 1,
2187 &derivativesO1_interp[1][0][0], 1, &Sxy[0], 1);
2190 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
2192 else if (m_spacedim == 3)
2195 Vmath::Vadd(nPts, &derivativesO1_interp[0][1][0], 1,
2196 &derivativesO1_interp[1][0][0], 1, &Sxy[0], 1);
2199 Vmath::Vadd(nPts, &derivativesO1_interp[0][2][0], 1,
2200 &derivativesO1_interp[2][0][0], 1, &Sxz[0], 1);
2203 Vmath::Vadd(nPts, &derivativesO1_interp[1][2][0], 1,
2204 &derivativesO1_interp[2][1][0], 1, &Syz[0], 1);
2207 Vmath::Vmul(nPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
2210 Vmath::Vmul(nPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
2213 Vmath::Vmul(nPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
2230 if (m_spacedim == 1)
2236 &Sgg[0][0], 1, &STx[0], 1);
2240 &derivativesO1_interp[0][1][0], 1, &tmp1[0], 1);
2243 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2245 else if (m_spacedim == 2)
2254 &Sgg[0][0], 1, &STx[0], 1);
2258 &Sxy[0], 1, &tmp1[0], 1);
2262 &derivativesO1_interp[0][2][0], 1, &tmp2[0], 1);
2265 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2266 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
2276 &Sgg[1][0], 1, &STy[0], 1);
2280 &Sxy[0], 1, &tmp1[0], 1);
2284 &derivativesO1_interp[1][2][0], 1, &tmp2[0], 1);
2287 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2288 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2290 else if (m_spacedim == 3)
2300 &Sgg[0][0], 1, &STx[0], 1);
2304 &Sxy[0], 1, &tmp1[0], 1);
2308 &Sxz[0], 1, &tmp2[0], 1);
2312 &derivativesO1_interp[0][3][0], 1, &tmp3[0], 1);
2315 Vmath::Vadd(nPts, &STx[0], 1, &tmp1[0], 1, &STx[0], 1);
2316 Vmath::Vadd(nPts, &STx[0], 1, &tmp2[0], 1, &STx[0], 1);
2317 Vmath::Vadd(nPts, &STx[0], 1, &tmp3[0], 1, &STx[0], 1);
2328 &Sgg[1][0], 1, &STy[0], 1);
2332 &Sxy[0], 1, &tmp1[0], 1);
2336 &Syz[0], 1, &tmp2[0], 1);
2340 &derivativesO1_interp[1][3][0], 1, &tmp3[0], 1);
2343 Vmath::Vadd(nPts, &STy[0], 1, &tmp1[0], 1, &STy[0], 1);
2344 Vmath::Vadd(nPts, &STy[0], 1, &tmp2[0], 1, &STy[0], 1);
2345 Vmath::Vadd(nPts, &STy[0], 1, &tmp3[0], 1, &STy[0], 1);
2356 &Sgg[2][0], 1, &STz[0], 1);
2360 &Sxz[0], 1, &tmp1[0], 1);
2364 &Syz[0], 1, &tmp2[0], 1);
2368 &derivativesO1_interp[2][3][0], 1, &tmp3[0], 1);
2371 Vmath::Vadd(nPts, &STz[0], 1, &tmp1[0], 1, &STz[0], 1);
2372 Vmath::Vadd(nPts, &STz[0], 1, &tmp2[0], 1, &STz[0], 1);
2373 Vmath::Vadd(nPts, &STz[0], 1, &tmp3[0], 1, &STz[0], 1);
2381 int nq = physfield[0].num_elements();
2383 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2386 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2389 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][2][0], 1);
2394 int nq = physfield[0].num_elements();
2396 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2398 Vmath::Zero(nq, &viscousTensor_interp[1][0][0], 1);
2401 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2403 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[1][1][0], 1);
2406 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[0][2][0], 1);
2408 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor_interp[1][2][0], 1);
2411 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][3][0], 1);
2413 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor_interp[1][3][0], 1);
2418 int nq = physfield[0].num_elements();
2420 Vmath::Zero(nq, &viscousTensor_interp[0][0][0], 1);
2422 Vmath::Zero(nq, &viscousTensor_interp[1][0][0], 1);
2424 Vmath::Zero(nq, &viscousTensor_interp[2][0][0], 1);
2427 Vmath::Vcopy(nPts, &Sgg[0][0], 1, &viscousTensor_interp[0][1][0], 1);
2429 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[1][1][0], 1);
2431 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor_interp[2][1][0], 1);
2434 Vmath::Vcopy(nPts, &Sxy[0], 1, &viscousTensor_interp[0][2][0], 1);
2436 Vmath::Vcopy(nPts, &Sgg[1][0], 1, &viscousTensor_interp[1][2][0], 1);
2438 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor_interp[2][2][0], 1);
2441 Vmath::Vcopy(nPts, &Sxz[0], 1, &viscousTensor_interp[0][3][0], 1);
2443 Vmath::Vcopy(nPts, &Syz[0], 1, &viscousTensor_interp[1][3][0], 1);
2445 Vmath::Vcopy(nPts, &Sgg[2][0], 1, &viscousTensor_interp[2][3][0], 1);
2448 Vmath::Vcopy(nPts, &STx[0], 1, &viscousTensor_interp[0][4][0], 1);
2450 Vmath::Vcopy(nPts, &STy[0], 1, &viscousTensor_interp[1][4][0], 1);
2452 Vmath::Vcopy(nPts, &STz[0], 1, &viscousTensor_interp[2][4][0], 1);
2457 ASSERTL0(
false,
"Illegal expansion dimension");
2463 for (j = 1; j < nVariables; ++j)
2466 m_fields[0]->PhysGalerkinProjection1DScaled(
2468 viscousTensor_interp[i][j],
2469 viscousTensor[i][j]);
2487 int nBCEdgePts = physfield[0].num_elements();
2491 Vmath::Vmul(nBCEdgePts, physfield[1], 1, physfield[1], 1, pressure, 1);
2494 Vmath::Vvtvp(nBCEdgePts, physfield[1+i], 1, physfield[1+i], 1,
2495 pressure, 1, pressure, 1);
2498 Vmath::Vdiv (nBCEdgePts, pressure, 1, physfield[0], 1, pressure, 1);
2501 pressure, 1, physfield[m_spacedim+1], 1, pressure, 1);
2520 Vmath::Vdiv(npts, pressure, 1, physfield[0], 1, enthalpy, 1);
2522 Vmath::Vadd(npts, tmp, 1, enthalpy, 1, enthalpy, 1);
2539 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
2540 const Array<OneD,
const Array<OneD, NekDouble> > &velocity,
2541 Array<OneD, NekDouble> &pressure)
2543 int nBCEdgePts = physfield[0].num_elements();
2547 Vmath::Vmul (nBCEdgePts, velocity[0], 1, physfield[1], 1, pressure, 1);
2550 Vmath::Vvtvp(nBCEdgePts, velocity[i], 1, physfield[1+i], 1,
2551 pressure, 1, pressure, 1);
2555 pressure, 1, physfield[m_spacedim+1], 1, pressure, 1);
2568 const Array<OneD, Array<OneD, NekDouble> > &physfield,
2569 Array<OneD, Array<OneD, NekDouble> > &velocity)
2571 const int nBCEdgePts = physfield[0].num_elements();
2575 Vmath::Vdiv(nBCEdgePts, physfield[1+i], 1, physfield[0], 1,
2588 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
2589 Array<OneD, NekDouble > &pressure,
2590 Array<OneD, NekDouble > &temperature)
2592 const int nq = physfield[0].num_elements();
2594 Vmath::Vdiv(nq, pressure, 1, physfield[0], 1, temperature, 1);
2606 const Array<OneD, Array<OneD, NekDouble> > &physfield,
2607 Array<OneD, NekDouble > &pressure,
2608 Array<OneD, NekDouble > &soundspeed)
2610 const int nq =
m_fields[0]->GetTotPoints();
2611 Vmath::Vdiv (nq, pressure, 1, physfield[0], 1, soundspeed, 1);
2624 Array<OneD, Array<OneD, NekDouble> > &physfield,
2625 Array<OneD, NekDouble > &soundspeed,
2626 Array<OneD, NekDouble > &mach)
2628 const int nq =
m_fields[0]->GetTotPoints();
2630 Vmath::Vmul(nq, physfield[1], 1, physfield[1], 1, mach, 1);
2638 Vmath::Vdiv(nq, mach, 1, physfield[0], 1, mach, 1);
2639 Vmath::Vdiv(nq, mach, 1, physfield[0], 1, mach, 1);
2655 const Array<OneD, const NekDouble> &temperature,
2656 Array<OneD, NekDouble> &mu)
2658 const int nPts = temperature.num_elements();
2663 for (
int i = 0; i < nPts; ++i)
2665 ratio = temperature[i] / T_star;
2666 mu[i] = mu_star * ratio * sqrt(ratio) *
2667 (T_star + 110.0) / (temperature[i] + 110.0);
2682 if (
m_comm->GetRank() == 0)
2684 cout <<
"Reached Steady State to tolerance "
2700 const int nFields =
m_fields.num_elements();
2703 Array<OneD, NekDouble> L2 (nFields);
2704 Array<OneD, NekDouble> residual(nFields);
2706 for (
int i = 0; i < nFields; ++i)
2708 Array<OneD, NekDouble> diff(nPoints);
2718 L2[0] = sqrt(residual[0]) /
m_rhoInf;
2720 for (
int i = 1; i < nFields-1; ++i)
2726 L2[nFields-1] = sqrt(residual[nFields-1]) / Einf;
2728 if (
m_comm->GetRank() == 0 && output)
2734 for (
int i = 0; i < nFields; ++i)
2736 m_errFile << setprecision(11) << setw(22) << scientific
2746 if (
m_session->DefinesCmdLineArgument(
"verbose") &&
2747 m_comm->GetRank() == 0 && output)
2749 cout <<
"-- Maximum L^2 residual: " << maxL2 << endl;
2757 for (
int i = 0; i <
m_fields.num_elements(); ++i)
2769 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
2770 const Array<OneD, const NekDouble> &pressure,
2771 const Array<OneD, const NekDouble> &temperature,
2772 Array<OneD, NekDouble> &entropy)
2775 const int npts =
m_fields[0]->GetTotPoints();
2777 Array<OneD, NekDouble> L2entropy(npts, 0.0);
2779 for (
int i = 0; i <
npts; ++i)
2783 log(pressure[i] /
m_pInf);
2786 Vmath::Vmul(npts, entropy, 1, entropy, 1, L2entropy, 1);
2790 entropy_sum = sqrt(entropy_sum);
2792 std::ofstream m_file(
"L2entropy.txt", std::ios_base::app);
2794 m_file << setprecision(16) << scientific << entropy_sum << endl;
2804 const Array<OneD,
const Array<OneD, NekDouble> > &inarray)
2807 int nElements =
m_fields[0]->GetExpSize();
2810 Array<OneD, NekDouble> tstep (nElements, 0.0);
2811 Array<OneD, NekDouble> stdVelocity(nElements);
2822 for(n = 0; n < nElements; ++n)
2824 int npoints =
m_fields[0]->GetExp(n)->GetTotPoints();
2825 Array<OneD, NekDouble> one2D(npoints, 1.0);
2828 minLength = sqrt(Area);
2829 if (
m_fields[0]->GetExp(n)->as<LocalRegions::TriExp>())
2835 / (stdVelocity[n] * cLambda
2836 * (ExpOrder[n] - 1) * (ExpOrder[n] - 1));
2850 bool dumpInitialConditions,
2853 if (
m_session->DefinesParameter(
"SteadyStateTol"))
2855 const int nPoints =
m_fields[0]->GetTotPoints();
2856 m_un = Array<OneD, Array<OneD, NekDouble> > (
2859 for (
int i = 0; i <
m_fields.num_elements(); ++i)
2862 m_un[i] = Array<OneD, NekDouble>(nPoints);
2866 if (
m_comm->GetRank() == 0)
2868 std::string fName =
m_session->GetSessionName() +
2869 std::string(
".res");
2872 << setw(15) << left <<
"Time"
2873 << setw(22) << left <<
"rho";
2875 std::string velFields[3] = {
"u",
"v",
"w"};
2877 for (
int i = 0; i <
m_fields.num_elements()-2; ++i)
2879 m_errFile << setw(22) <<
"rho"+velFields[i];
2882 m_errFile << setw(22) << left <<
"E" << endl;
2896 const Array<OneD,
const Array<OneD, NekDouble> > &inarray,
2897 Array<OneD, NekDouble> &stdV)
2900 int n_element =
m_fields[0]->GetExpSize();
2904 Array<OneD, Array<OneD, NekDouble> > velocity (
m_spacedim);
2905 Array<OneD, Array<OneD, NekDouble> > stdVelocity(
m_spacedim);
2906 Array<OneD, NekDouble> pressure (nTotQuadPoints);
2907 Array<OneD, NekDouble> soundspeed (nTotQuadPoints);
2915 velocity [i] = Array<OneD, NekDouble>(nTotQuadPoints);
2916 stdVelocity[i] = Array<OneD, NekDouble>(nTotQuadPoints, 0.0);
2923 for(
int el = 0; el < n_element; ++el)
2925 ptsKeys =
m_fields[0]->GetExp(el)->GetPointsKeys();
2929 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo();
2930 const Array<TwoD, const NekDouble> &gmat =
2931 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo()
2932 ->GetDerivFactors(ptsKeys);
2934 int nq =
m_fields[0]->GetExp(el)->GetTotPoints();
2946 1, stdVelocity[i], 1, stdVelocity[i], 1);
2959 1, stdVelocity[i], 1, stdVelocity[i], 1);
2964 for (
int i = 0; i < nq; ++i)
2969 pntVelocity += stdVelocity[j][i]*stdVelocity[j][i];
2971 pntVelocity = sqrt(pntVelocity) + soundspeed[nBCEdgePts];
2972 if (pntVelocity > stdV[el])
2974 stdV[el] = pntVelocity;
2990 ASSERTL0(n <= 20,
"Illegal modes dimension for CFL calculation "
2991 "(P has to be less then 20)");
2993 NekDouble CFLDG[21] = { 2.0000, 6.0000, 11.8424, 19.1569,
2994 27.8419, 37.8247, 49.0518, 61.4815,
2995 75.0797, 89.8181, 105.6700, 122.6200,
2996 140.6400, 159.7300, 179.8500, 201.0100,
2997 223.1800, 246.3600, 270.5300, 295.6900,
3007 ASSERTL0(
false,
"Continuous Galerkin stability coefficients "
3008 "not introduced yet.");
3022 const Array<OneD,int> &ExpOrder)
3026 for (i =0; i<
m_fields[0]->GetExpSize(); i++)
3034 const Array<OneD,
const Array<OneD, NekDouble> > &physarray,
3035 Array<OneD, NekDouble> &Sensor,
3036 Array<OneD, NekDouble> &SensorKappa)
3038 int e, NumModesElement, nQuadPointsElement;
3040 int nElements =
m_fields[0]->GetExpSize();
3047 Array<OneD, NekDouble> SolP (nTotQuadPoints, 0.0);
3048 Array<OneD, NekDouble> SolPmOne(nTotQuadPoints, 0.0);
3049 Array<OneD, NekDouble> SolNorm (nTotQuadPoints, 0.0);
3051 Vmath::Vcopy(nTotQuadPoints, physarray[0], 1, SolP, 1);
3053 int CoeffsCount = 0;
3055 for (e = 0; e < nElements; e++)
3057 NumModesElement = ExpOrderElement[e];
3058 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3059 int nCoeffsElement =
m_fields[0]->GetExp(e)->GetNcoeffs();
3060 int numCutOff = NumModesElement - 1;
3065 Array<OneD, NekDouble> SolPElementPhys (nQuadPointsElement, 0.0);
3066 Array<OneD, NekDouble> SolPElementCoeffs(nCoeffsElement, 0.0);
3068 Array<OneD, NekDouble> SolPmOneElementPhys(nQuadPointsElement, 0.0);
3069 Array<OneD, NekDouble> SolPmOneElementCoeffs(nCoeffsElement, 0.0);
3073 for (
int i = 0; i < nQuadPointsElement; i++)
3075 SolPElementPhys[i] = SolP[CoeffsCount+i];
3078 m_fields[0]->GetExp(e)->FwdTrans(SolPElementPhys,
3086 m_fields[0]->GetExp(e)->ReduceOrderCoeffs(numCutOff,
3088 SolPmOneElementCoeffs);
3090 m_fields[0]->GetExp(e)->BwdTrans(SolPmOneElementCoeffs,
3091 SolPmOneElementPhys);
3093 for (
int i = 0; i < nQuadPointsElement; i++)
3095 SolPmOne[CoeffsCount+i] = SolPmOneElementPhys[i];
3105 SolPmOneElementPhys, 1,
3113 for (
int i = 0; i < nQuadPointsElement; i++)
3115 SolPmeanNumerator += SolNorm[i];
3116 SolPmeanDenumerator += SolPElementPhys[i];
3119 for (
int i = 0; i < nQuadPointsElement; ++i)
3121 Sensor[CoeffsCount+i] =
3122 sqrt(SolPmeanNumerator / nQuadPointsElement) /
3123 sqrt(SolPmeanDenumerator / nQuadPointsElement);
3125 Sensor[CoeffsCount+i] = log10(Sensor[CoeffsCount+i]);
3127 CoeffsCount += nQuadPointsElement;
3132 for (e = 0; e < nElements; e++)
3134 NumModesElement = ExpOrderElement[e];
3138 nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3140 for (
int i = 0; i < nQuadPointsElement; i++)
3142 if (Sensor[CoeffsCount+i] <= (Phi0 - DeltaPhi))
3144 SensorKappa[CoeffsCount+i] = 0;
3146 else if(Sensor[CoeffsCount+i] >= (Phi0 + DeltaPhi))
3148 SensorKappa[CoeffsCount+i] = ThetaS;
3150 else if(abs(Sensor[CoeffsCount+i]-Phi0) < DeltaPhi)
3152 SensorKappa[CoeffsCount+i] =
3153 ThetaS / 2 * (1 + sin(M_PI * (Sensor[CoeffsCount+i] -
3154 Phi0) / (2 * DeltaPhi)));
3158 CoeffsCount += nQuadPointsElement;
3164 const Array<OneD,
const Array<OneD, NekDouble> > &inarray,
3165 Array<OneD, Array<OneD, NekDouble> > outarrayForcing)
3167 const int nPts =
m_fields[0]->GetTotPoints();
3168 const int nvariables =
m_fields.num_elements();
3169 const int nElements =
m_fields[0]->GetExpSize();
3171 Array<OneD, NekDouble> Sensor(nPts, 0.0);
3172 Array<OneD, NekDouble> SensorKappa(nPts, 0.0);
3173 Array <OneD, NekDouble > Lambda(nPts, 0.0);
3174 Array <OneD, NekDouble >
Tau(nPts, 1.0);
3175 Array <OneD, NekDouble > soundspeed(nPts, 0.0);
3176 Array <OneD, NekDouble > pressure(nPts, 0.0);
3177 Array <OneD, NekDouble > temperature(nPts, 0.0);
3178 Array <OneD, NekDouble > absVelocity(nPts, 0.0);
3179 Array <OneD, NekDouble > hel(nPts, 0.0);
3180 Array <OneD, NekDouble > h_minmin(m_spacedim, 0.0);
3183 Array<OneD, NekDouble> pOrder (nPts, 0.0);
3190 GetSensor(inarray, Sensor, SensorKappa);
3193 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
3199 for (
int e = 0; e < nElements; e++)
3201 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3203 for (
int n = 0; n < nQuadPointsElement; n++)
3205 pOrder[n + PointCount] = pOrderElmt[e];
3208 Tau[n + PointCount] =
3209 1.0 / (
m_C1*pOrder[n + PointCount]*LambdaMax);
3211 outarrayForcing[nvariables-1][n + PointCount] =
3213 pOrder[n + PointCount] *
3214 SensorKappa[n + PointCount] -
3215 inarray[nvariables-1][n + PointCount]);
3217 PointCount += nQuadPointsElement;
3222 Array<OneD, Array<OneD, NekDouble> > &outarray,
3223 Array<OneD, NekDouble > &hmin)
3226 const int nElements =
m_fields[0]->GetExpSize();
3233 for (
int e = 0; e < nElements; e++)
3236 Array <OneD, NekDouble> L1(nedges, 0.0);
3238 for (
int j = 0; j < nedges; ++j)
3249 if (boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3250 m_fields[0]->GetExp(e)->GetGeom()))
3253 boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3254 m_fields[0]->GetExp(e)->GetGeom());
3256 ElQuadGeom->GetEdge(j)->GetVertex(0)->GetCoords(x0, y0, z0);
3257 ElQuadGeom->GetEdge(j)->GetVertex(1)->GetCoords(x1, y1, z1);
3259 L1[j] = sqrt(pow((x0-x1),2)+pow((y0-y1),2)+pow((z0-z1),2));
3263 ASSERTL0(
false,
"GetElementDimensions() is only "
3264 "implemented for quadrilateral elements");
3270 if(boost::dynamic_pointer_cast<SpatialDomains::QuadGeom>(
3271 m_fields[0]->GetExp(e)->GetGeom()))
3273 hx = min(L1[0], L1[2]);
3274 hy = min(L1[1], L1[3]);
3276 outarray[0][e] = hx;
3277 outarray[1][e] = hy;
3281 hmin[0] =
Vmath::Vmin(outarray[0].num_elements(), outarray[0], 1);
3282 hmin[1] =
Vmath::Vmin(outarray[1].num_elements(), outarray[1], 1);
3286 const Array<OneD,
const Array<OneD, NekDouble> > &inarray,
3287 Array<OneD, NekDouble> &Vtot)
3292 Array<OneD, Array<OneD, NekDouble> > velocity (m_spacedim);
3298 velocity[i] = Array<OneD, NekDouble>(nTotQuadPoints);
3316 const Array<OneD, Array<OneD, NekDouble> > &physfield,
3317 Array<OneD, NekDouble > &eps_bar)
3319 int nvariables = physfield.num_elements();
3320 int nPts =
m_fields[0]->GetTotPoints();
3322 Array<OneD, NekDouble > pressure (nPts, 0.0);
3323 Array<OneD, NekDouble > temperature(nPts, 0.0);
3324 Array<OneD, NekDouble > sensor (nPts, 0.0);
3325 Array<OneD, NekDouble > SensorKappa(nPts, 0.0);
3326 Array<OneD, NekDouble > absVelocity(nPts, 0.0);
3327 Array<OneD, NekDouble > soundspeed (nPts, 0.0);
3328 Array<OneD, NekDouble > Lambda (nPts, 0.0);
3329 Array<OneD, NekDouble > mu_var (nPts, 0.0);
3330 Array<OneD, NekDouble > h_minmin (m_spacedim, 0.0);
3338 GetSensor(physfield, sensor, SensorKappa);
3341 Vmath::Vadd(nPts, absVelocity, 1, soundspeed, 1, Lambda, 1);
3359 for (
int e = 0; e < eps_bar.num_elements(); e++)
3361 if (physfield[nvariables-1][e] <= (Phi0 - DeltaPhi))
3365 else if(physfield[nvariables-1][e] >= (Phi0 + DeltaPhi))
3369 else if(abs(physfield[nvariables-1][e]-Phi0) < DeltaPhi)
3371 eps_bar[e] =
m_mu0/2*(1+sin(M_PI*
3372 (physfield[nvariables-1][e]-Phi0)/(2*DeltaPhi)));
3379 const Array<OneD, Array<OneD, NekDouble> > &physfield,
3380 Array<OneD, NekDouble > &mu_var)
3382 const int nElements =
m_fields[0]->GetExpSize();
3386 Array<OneD, NekDouble> S_e (nTotQuadPoints, 0.0);
3387 Array<OneD, NekDouble> se (nTotQuadPoints, 0.0);
3388 Array<OneD, NekDouble> Sensor (nTotQuadPoints, 0.0);
3389 Array<OneD, NekDouble> SensorKappa(nTotQuadPoints, 0.0);
3390 Array<OneD, NekDouble> absVelocity(nTotQuadPoints, 0.0);
3391 Array<OneD, NekDouble> soundspeed (nTotQuadPoints, 0.0);
3392 Array<OneD, NekDouble> pressure (nTotQuadPoints, 0.0);
3397 GetSensor (physfield, Sensor, SensorKappa);
3400 Array<OneD, NekDouble> Lambda(nTotQuadPoints, 1.0);
3401 Vmath::Vadd(nTotQuadPoints, absVelocity, 1, soundspeed, 1, Lambda, 1);
3403 for (
int e = 0; e < nElements; e++)
3414 int nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3415 Array <OneD, NekDouble> one2D(nQuadPointsElement, 1.0);
3417 for (
int n = 0; n < nQuadPointsElement; n++)
3423 mu_var[n+PointCount] = 0;
3428 mu_var[n+PointCount] = mu_0 * (0.5 * (1 + sin(
3429 M_PI * (Sensor[n+PointCount] -
3435 mu_var[n+PointCount] = mu_0;
3439 PointCount += nQuadPointsElement;
3444 const Array<OneD,
const Array<OneD, NekDouble> > &physfield,
3445 Array<OneD, NekDouble > &PolyOrder)
3450 int nElements =
m_fields[0]->GetExpSize();
3451 int npts =
m_fields[0]->GetTotPoints();
3453 Array<OneD, NekDouble > Sensor (npts, 0.0);
3454 Array<OneD, NekDouble > SensorKappa(npts, 0.0);
3455 Array<OneD, NekDouble > se (npts, 0.0);
3457 GetSensor(physfield, Sensor, SensorKappa);
3459 int nQuadPointsElement = 0;
3463 int MinOrderShock = 4;
3465 std::ofstream m_file(
"VariablePComposites.txt", std::ios_base::app);
3466 for (
int e = 0; e < nElements; e++)
3468 m_file <<
"<C ID=\"" << e+1 <<
"\"> Q[" << e <<
"] </C>"<< endl;
3472 std::ofstream m_file2(
"VariablePExpansions.txt", std::ios_base::app);
3474 for (e = 0; e < nElements; e++)
3476 nQuadPointsElement =
m_fields[0]->GetExp(e)->GetTotPoints();
3487 for (
int i = 0; i < nQuadPointsElement; i++)
3489 se[npCount + i] = (Sensor[npCount + i]);
3491 if (se[npCount + i] > s_ds)
3493 if (PolyOrder[npCount + i] > MinOrderShock)
3495 PolyOrder[npCount + i] = PolyOrder[npCount + i] - 1;
3497 else if(PolyOrder[e] < MinOrderShock)
3499 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 1;
3503 else if (se[npCount + i] > s_sm && se[npCount + i] < s_ds)
3505 if (PolyOrder[npCount + i] < MaxOrder)
3507 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 2;
3510 else if (se[npCount + i] > s_fl && se[npCount + i] < s_sm)
3512 PolyOrder[npCount + i] = PolyOrder[npCount + i] + 1;
3514 else if (se[npCount + i] < s_fl)
3516 if (PolyOrder[npCount + i] > MinOrder)
3518 PolyOrder[npCount + i] = PolyOrder[npCount + i];
3522 m_file2 <<
"<E COMPOSITE= \"C[" << e+1
3523 <<
"]\" NUMMODES=\"" << PolyOrder[npCount + 1]
3524 <<
"\" TYPE=\"MODIFIED\" FIELDS=\"rho,rhou,rhov,rhow,E\" />"
3526 npCount += nQuadPointsElement;
3533 std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
3534 std::vector<std::string> &variables)
3536 const int nPhys =
m_fields[0]->GetNpoints();
3537 const int nCoeffs =
m_fields[0]->GetNcoeffs();
3538 Array<OneD, Array<OneD, NekDouble> > tmp(
m_fields.num_elements());
3540 for (
int i = 0; i <
m_fields.num_elements(); ++i)
3545 Array<OneD, NekDouble> pressure(nPhys), soundspeed(nPhys), mach(nPhys);
3546 Array<OneD, NekDouble> sensor(nPhys), SensorKappa(nPhys), smooth(nPhys);
3550 GetMach (tmp, soundspeed, mach);
3554 Array<OneD, NekDouble> pFwd(nCoeffs), sFwd(nCoeffs), mFwd(nCoeffs);
3555 Array<OneD, NekDouble> sensFwd(nCoeffs), smoothFwd(nCoeffs);
3557 m_fields[0]->FwdTrans(pressure, pFwd);
3558 m_fields[0]->FwdTrans(soundspeed, sFwd);
3560 m_fields[0]->FwdTrans(sensor, sensFwd);
3561 m_fields[0]->FwdTrans(smooth, smoothFwd);
3563 variables.push_back (
"p");
3564 variables.push_back (
"a");
3565 variables.push_back (
"Mach");
3566 variables.push_back (
"Sensor");
3567 variables.push_back (
"SmoothVisc");
3568 fieldcoeffs.push_back(pFwd);
3569 fieldcoeffs.push_back(sFwd);
3570 fieldcoeffs.push_back(mFwd);
3571 fieldcoeffs.push_back(sensFwd);
3572 fieldcoeffs.push_back(smoothFwd);
void GetMach(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &soundspeed, Array< OneD, NekDouble > &mach)
#define ASSERTL0(condition, msg)
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
Array< OneD, Array< OneD, NekDouble > > m_fieldStorage
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 WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall 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.
void SymmetryBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Symmetry boundary conditions for compressible flow problems.
void RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Outflow characteristic boundary conditions for compressible flow problems.
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.
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()
void PressureOutflowBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
void PressureOutflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow boundary conditions for compressible flow problems.
void PressureOutflowNonReflectiveBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure outflow non-reflective boundary conditions for compressible flow problems.
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 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 > > &Fwd, 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 PressureInflowFileBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Pressure inflow boundary conditions for compressible flow problems where either the density and the v...
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 SetCommonBC(const std::string &userDefStr, const int n, const NekDouble time, int &cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &inarray)
Set boundary conditions which can be: a) Wall and Symmerty BCs implemented at CompressibleFlowSystem ...
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.
void ExtrapOrder0BC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Extrapolation of order 0 for all the variables such that, at the boundaries, a trivial Riemann proble...
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.