202 size_t n, cnt, elmtid, nq, offset, boundary;
203 size_t nt = pFields[0]->GetNpoints();
204 size_t dim = pFields.size() - 1;
232 size_t Num_z_pos = pFields[0]->GetHomogeneousBasis()->GetNumModes();
240 NekDouble rho = (pSession->DefinesParameter(
"rho"))
241 ? (pSession->GetParameter(
"rho"))
243 NekDouble mu = rho * pSession->GetParameter(
"Kinvis");
245 for (
size_t i = 0; i < pFields.size(); ++i)
247 pFields[i]->SetWaveSpace(
false);
248 pFields[i]->BwdTrans(pFields[i]->GetCoeffs(), pFields[i]->UpdatePhys());
249 pFields[i]->SetPhysState(
true);
255 ZIDs = pFields[0]->GetZIDs();
256 size_t local_planes = ZIDs.size();
260 for (
size_t plane = 0; plane < local_planes; plane++)
262 pFields[0]->GetPlane(plane)->GetBoundaryToElmtMap(BoundarytoElmtID,
264 BndExp = pFields[0]->GetPlane(plane)->GetBndCondExpansions();
268 for (cnt = n = 0; n < BndExp.size(); ++n)
272 size_t nExp = BndExp[n]->GetExpSize();
273 for (
size_t i = 0; i < nExp; ++i, cnt++)
276 elmtid = BoundarytoElmtID[cnt];
277 elmt = pFields[0]->GetPlane(plane)->GetExp(elmtid);
278 nq = elmt->GetTotPoints();
280 pFields[0]->GetPlane(plane)->GetPhys_Offset(elmtid);
285 for (
size_t j = 0; j < dim; ++j)
293 boundary = BoundarytoTraceID[cnt];
296 U = pFields[0]->GetPlane(plane)->GetPhys() + offset;
297 V = pFields[1]->GetPlane(plane)->GetPhys() + offset;
298 P = pFields[3]->GetPlane(plane)->GetPhys() + offset;
301 elmt->PhysDeriv(U, gradU[0], gradU[1]);
302 elmt->PhysDeriv(V, gradV[0], gradV[1]);
313 for (
size_t j = 0; j < dim; ++j)
327 boundary = BoundarytoTraceID[cnt];
331 elmt->GetTracePhysVals(boundary, bc,
P, Pb);
333 for (
size_t j = 0; j < dim; ++j)
335 elmt->GetTracePhysVals(boundary, bc, gradU[j],
337 elmt->GetTracePhysVals(boundary, bc, gradV[j],
343 elmt->GetTraceNormal(boundary);
362 Vmath::Vadd(nbc, fgradU[1], 1, fgradV[0], 1, drag_t, 1);
363 Vmath::Vmul(nbc, drag_t, 1, normals[1], 1, drag_t, 1);
366 Vmath::Vmul(nbc, fgradU[0], 1, normals[0], 1, temp2, 1);
379 Vmath::Vadd(nbc, fgradU[1], 1, fgradV[0], 1, lift_t, 1);
380 Vmath::Vmul(nbc, lift_t, 1, normals[0], 1, lift_t, 1);
383 Vmath::Vmul(nbc, fgradV[1], 1, normals[1], 1, temp2, 1);
384 Vmath::Smul(nbc, -0.5, fgradV[1], 1, fgradV[1], 1);
392 Vmath::Vvtvp(nbc, Pb, 1, normals[0], 1, drag_p, 1, drag_p,
394 Vmath::Vvtvp(nbc, Pb, 1, normals[1], 1, lift_p, 1, lift_p,
398 Fxv[ZIDs[plane]] += bc->Integral(drag_t);
399 Fyv[ZIDs[plane]] += bc->Integral(lift_t);
401 Fxp[ZIDs[plane]] += bc->Integral(drag_p);
402 Fyp[ZIDs[plane]] += bc->Integral(lift_p);
407 cnt += BndExp[n]->GetExpSize();
412 for (
size_t i = 0; i < pFields.size(); ++i)
414 pFields[i]->SetWaveSpace(
true);
415 pFields[i]->BwdTrans(pFields[i]->GetCoeffs(), pFields[i]->UpdatePhys());
416 pFields[i]->SetPhysState(
false);
425 if (vComm->GetRowComm()->GetSize() > 0)
432 for (
size_t plane = 0; plane < local_planes; plane++)
447 if (!pSession->DefinesSolverInfo(
"HomoStrip"))
449 if (vComm->GetRowComm()->GetRank() == 0)
451 for (
size_t z = 0; z < Num_z_pos; z++)
462 if (vComm->GetRowComm()->GetRank() == 0)
464 for (
size_t z = 0; z < Num_z_pos; z++)
474 if (!pSession->DefinesSolverInfo(
"HomoStrip"))
477 for (
size_t plane = 0; plane < local_planes; plane++)
479 Aeroforces[plane] = Fxp[ZIDs[plane]] + Fxv[ZIDs[plane]];
480 Aeroforces[plane + local_planes] =
481 Fyp[ZIDs[plane]] + Fyv[ZIDs[plane]];
497 pFields[0]->GetHomogeneousBasis()->GetZ();
500 pSession->LoadParameter(
"LZ", LZ);
501 Vmath::Smul(Num_z_pos, LZ / 2.0, pts, 1, z_coords, 1);
502 Vmath::Sadd(Num_z_pos, LZ / 2.0, z_coords, 1, z_coords, 1);
503 if (vComm->GetRank() == 0)
509 for (
size_t i = 0; i < Num_z_pos; i++)
538 for (
size_t plane = 0; plane < local_planes; plane++)
540 fces[0] += Fxp[ZIDs[plane]] + Fxv[ZIDs[plane]];
541 fces[1] += Fyp[ZIDs[plane]] + Fyv[ZIDs[plane]];
542 fces[2] += Fxp[ZIDs[plane]];
543 fces[3] += Fyp[ZIDs[plane]];
544 fces[4] += Fxv[ZIDs[plane]];
545 fces[5] += Fyv[ZIDs[plane]];
548 fces[0] = fces[0] / local_planes;
549 fces[1] = fces[1] / local_planes;
550 fces[2] = fces[2] / local_planes;
551 fces[3] = fces[3] / local_planes;
552 fces[4] = fces[4] / local_planes;
553 fces[5] = fces[5] / local_planes;
563 size_t npts = vComm->GetColumnComm()->GetColumnComm()->GetSize();
565 fces[0] = fces[0] / npts;
566 fces[1] = fces[1] / npts;
567 fces[2] = fces[2] / npts;
568 fces[3] = fces[3] / npts;
569 fces[4] = fces[4] / npts;
570 fces[5] = fces[5] / npts;
572 for (
size_t plane = 0; plane < local_planes; plane++)
574 Aeroforces[plane] = fces[0];
575 Aeroforces[plane + local_planes] = fces[1];
584 size_t colrank = vColComm->GetRank();
589 pSession->LoadParameter(
"Strip_Z", nstrips);
590 pSession->LoadParameter(
"DistStrip", DistStrip);
593 for (
size_t i = 0; i < nstrips; i++)
595 z_coords[i] = i * DistStrip;
621 for (
size_t i = 1; i < nstrips; i++)
623 vColComm->Recv(i, fces);
649 for (
size_t i = 1; i < nstrips; i++)
653 vColComm->Send(0, fces);