75 int nvariables = physarray.num_elements();
81 int nPointsTot =
m_fields[0]->GetTotPoints();
82 int nPointsTot_plane =
m_fields[0]->GetPlane(0)->GetTotPoints();
83 n_planes = nPointsTot/nPointsTot_plane;
86 int id2, id2_plane, e_max;
90 for(
int e = 0; e < e_max; ++e)
93 GetBndCondExpansions()[
m_bcRegion]->GetExp(e)->GetTotPoints();
95 GetBndCondExpansions()[
m_bcRegion]->GetPhys_Offset(e);
100 int m_offset_plane =
m_offset/n_planes;
102 int e_max_plane = e_max/n_planes;
103 int nTracePts_plane =
m_fields[0]->GetTrace()->GetNpoints();
105 int planeID = floor((e + 0.5 )/ e_max_plane );
106 e_plane = e - e_max_plane*planeID;
108 id2_plane =
m_fields[0]->GetTrace()->GetPhys_Offset(
110 GetBndCondCoeffsToGlobalCoeffsMap(
111 m_offset_plane + e_plane));
112 id2 = id2_plane + planeID*nTracePts_plane;
117 GetTrace()->GetPhys_Offset(
m_fields[0]->GetTraceMap()->
118 GetBndCondTraceToGlobalTraceMap(
m_offset+e));
121 Array<OneD,NekDouble> x0(npoints, 0.0);
122 Array<OneD,NekDouble> x1(npoints, 0.0);
123 Array<OneD,NekDouble> x2(npoints, 0.0);
126 GetExp(e)->GetCoords(x0, x1, x2);
129 NekDouble c, k, phi, r, J, VV, pp, sint,
P, ss;
143 NekDouble gamma_1_2 = (gamma - 1.0) / 2.0;
146 for (
int j = 0; j < npoints; j++)
149 while ((abs(errV) > toll) || (abs(errTheta) > toll))
153 c = sqrt(1.0 - gamma_1_2 * VV);
157 J = 1.0 / c + 1.0 / (3.0 * c * c * c) +
158 1.0 / (5.0 * c * c * c * c * c) -
159 0.5 * log((1.0 + c) / (1.0 - c));
161 r = pow(c, 1.0 / gamma_1_2);
162 xi = 1.0 / (2.0 * r) * (1.0 / VV - 2.0 * pp) + J / 2.0;
163 yi = phi / (r * V) * sqrt(1.0 - VV * pp);
164 par1 = 25.0 - 5.0 * VV;
170 J11 = 39062.5 / pow(par1, 3.5) *
171 (1.0 / VV - 2.0 / VV * ss) * V + 1562.5 /
172 pow(par1, 2.5) * (-2.0 / (VV * V) + 4.0 /
173 (VV * V) * ss) + 12.5 / pow(par1, 1.5) * V +
174 312.5 / pow(par1, 2.5) * V + 7812.5 /
175 pow(par1, 3.5) * V - 0.25 *
176 (-1.0 / pow(par1, 0.5) * V / (1.0 - 0.2 *
177 pow(par1, 0.5)) - (1.0 + 0.2 * pow(par1, 0.5)) /
178 pow((1.0 - 0.2 * pow(par1, 0.5)), 2.0) /
179 pow(par1, 0.5) * V) / (1.0 + 0.2 * pow(par1, 0.5)) *
180 (1.0 - 0.2 * pow(par1, 0.5));
182 J12 = -6250.0 / pow(par1, 2.5) / VV * sint * cos(theta);
183 J21 = -6250.0 / (VV * V) * sint / pow(par1, 2.5) *
184 pow((1.0 - ss), 0.5) + 78125.0 / V * sint /
185 pow(par1, 3.5) * pow((1.0 - ss), 0.5);
188 if (abs(x1[j]) < toll && abs(cos(theta)) < toll)
190 J22 = -39062.5 / pow(par1, 3.5) / V + 3125 /
191 pow(par1, 2.5) / (VV * V) + 12.5 /
192 pow(par1, 1.5) * V + 312.5 / pow(par1, 2.5) *
193 V + 7812.5 / pow(par1, 3.5) * V - 0.25 *
194 (-1.0 / pow(par1, 0.5) * V / (1.0 - 0.2 *
195 pow(par1, 0.5)) - (1.0 + 0.2 * pow(par1, 0.5)) /
196 pow((1.0 - 0.2 * pow(par1, 0.5)), 2.0) /
197 pow(par1, 0.5) * V) / (1.0 + 0.2 *
198 pow(par1, 0.5)) * (1.0 - 0.2 * pow(par1, 0.5));
201 dV = -1.0 / J22 * Fx;
207 J22 = 3125.0 / VV * cos(theta) / pow(par1, 2.5) *
208 pow((1.0 - ss), 0.5) - 3125.0 / VV * ss /
209 pow(par1, 2.5) / pow((1.0 - ss), 0.5) *
212 det = -1.0 / (J11 * J22 - J12 * J21);
215 dV = det * ( J22 * Fx - J12 * Fy);
216 dtheta = det * (-J21 * Fx + J11 * Fy);
220 theta = theta + dtheta;
223 errTheta = abs(dtheta);
226 c = sqrt(1.0 - gamma_1_2 * VV);
230 !(
m_session->DefinesFunction(
"InitialConditions") &&
231 m_session->GetFunctionType(
"InitialConditions", 0) ==
234 Fwd[0][kk] = pow(c, 1.0 / gamma_1_2) *
235 exp(-1.0 + time /timeramp);
237 Fwd[1][kk] = Fwd[0][kk] * V * cos(theta) *
238 exp(-1 + time / timeramp);
240 Fwd[2][kk] = Fwd[0][kk] * V * sin(theta) *
241 exp(-1 + time / timeramp);
245 Fwd[0][kk] = pow(c, 1.0 / gamma_1_2);
246 Fwd[1][kk] = Fwd[0][kk] * V * cos(theta);
247 Fwd[2][kk] = Fwd[0][kk] * V * sin(theta);
250 P = (c * c) * Fwd[0][kk] / gamma;
251 Fwd[3][kk] = P / (gamma - 1.0) + 0.5 *
252 (Fwd[1][kk] * Fwd[1][kk] / Fwd[0][kk] +
253 Fwd[2][kk] * Fwd[2][kk] / Fwd[0][kk]);
258 V = kExt * sin(theta);
261 for (
int i = 0; i < nvariables; ++i)
265 UpdatePhys())[id1],1);
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
NekDouble m_gamma
Parameters of the flow.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
int m_bcRegion
Id of the boundary region.