13#if not defined(MAIA_MS_COMPILER)
87 stringstream errorMessage;
88 errorMessage <<
"Number of Variables " <<
m_solver->
CV->noVariables
89 <<
" not implemented! in temlate Rans AUSM " << endl;
90 mTerm(1, AT_, errorMessage.str());
103 AusmDV = Context::getSolverProperty<MBool>(
"AusmDV",
m_solverId, AT_, &AusmDV);
108 m_log <<
"Using RANS with K-Epsilon model and limited AusmDV" << endl;
113 : &FvStructuredSolver2DRans::Muscl_Ausm_Limited<6, 2, true>;
116 : &FvStructuredSolver2DRans::Muscl_Ausm_Limited<6, 2>;
122 : &FvStructuredSolver2DRans::Muscl_Ausm_Limited<7, 2, true>;
125 : &FvStructuredSolver2DRans::Muscl_Ausm_Limited<7, 2>;
129 stringstream errorMessage;
130 errorMessage <<
"Number of Variables " <<
m_solver->
CV->noVariables
131 <<
" not implemented! in temlate Rans AUSM " << endl;
132 mTerm(1, AT_, errorMessage.str());
136 if(!AusmDV)
mTerm(1,
"Not implemented yet!");
137 m_log <<
"Using RANS with K-Epsilon model and AusmDV" << endl;
154 stringstream errorMessage;
155 errorMessage <<
"Number of Variables " <<
m_solver->
CV->noVariables
156 <<
" not implemented! in temlate Rans AUSM " << endl;
157 mTerm(1, AT_, errorMessage.str());
164 mTerm(1, AT_,
"RANS METHOD wsa not specified in properties");
172template <MInt noVars, MInt noRANS, MBool rans2eq_production_mode>
188 const MFloat gammaMinusOne = gamma - 1.0;
189 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
198 for(
MInt dim = 0; dim <
nDim; dim++) {
200#pragma omp parallel for
202 for(
MInt j = 0; j < noCellsJP1; j++) {
203 for(
MInt i = 0; i < noCellsIP1; i++) {
205 const MInt IP1 = I + IJ[dim];
206 dss[dim][I] = sqrt(
POW2(x[IP1] - x[I]) +
POW2(
y[IP1] -
y[I]));
215 for(
MInt dim = 0; dim <
nDim; dim++) {
216 for(
MInt j = 1; j < noCellsJ; j++) {
217 for(
MInt i = 1; i < noCellsI; i++) {
219 const MInt IP1 = I + IJ[dim];
220 const MInt IM1 = I - IJ[dim];
221 const MInt IP2 = I + 2 * IJ[dim];
223 const MFloat DS = dss[dim][I];
224 const MFloat DSM1 = dss[dim][IM1];
225 const MFloat DSP1 = dss[dim][IP1];
232 const MFloat DQU = vars[
PV->U][IP1] - vars[
PV->U][I];
233 const MFloat DQPU = vars[
PV->U][IP2] - vars[
PV->U][IP1];
234 const MFloat DQMU = vars[
PV->U][I] - vars[
PV->U][IM1];
235 MFloat UL = vars[
PV->U][I] + DSM * (DSM1 * DQU + DS * DQMU);
236 MFloat UR = vars[
PV->U][IP1] - DSP * (DS * DQPU + DSP1 * DQU);
238 const MFloat DQV = vars[
PV->V][IP1] - vars[
PV->V][I];
239 const MFloat DQPV = vars[
PV->V][IP2] - vars[
PV->V][IP1];
240 const MFloat DQMV = vars[
PV->V][I] - vars[
PV->V][IM1];
241 MFloat VL = vars[
PV->V][I] + DSM * (DSM1 * DQV + DS * DQMV);
242 MFloat VR = vars[
PV->V][IP1] - DSP * (DS * DQPV + DSP1 * DQV);
244 const MFloat DQP = vars[
PV->P][IP1] - vars[
PV->P][I];
245 const MFloat DQPP = vars[
PV->P][IP2] - vars[
PV->P][IP1];
246 const MFloat DQMP = vars[
PV->P][I] - vars[
PV->P][IM1];
247 const MFloat PL = vars[
PV->P][I] + DSM * (DSM1 * DQP + DS * DQMP);
248 const MFloat PR = vars[
PV->P][IP1] - DSP * (DS * DQPP + DSP1 * DQP);
250 const MFloat DQRHO = vars[
PV->RHO][IP1] - vars[
PV->RHO][I];
251 const MFloat DQPRHO = vars[
PV->RHO][IP2] - vars[
PV->RHO][IP1];
252 const MFloat DQMRHO = vars[
PV->RHO][I] - vars[
PV->RHO][IM1];
253 const MFloat RHOL = vars[
PV->RHO][I] + DSM * (DSM1 * DQRHO + DS * DQMRHO);
254 const MFloat RHOR = vars[
PV->RHO][IP1] - DSP * (DS * DQPRHO + DSP1 * DQRHO);
261 for(
MInt v = 0; v < noRANS; ++v) {
262 const MFloat DQRANSVAR = vars[
PV->RANS_VAR[v]][IP1] - vars[
PV->RANS_VAR[v]][I];
263 const MFloat DQPRANSVAR = vars[
PV->RANS_VAR[v]][IP2] - vars[
PV->RANS_VAR[v]][IP1];
264 const MFloat DQMRANSVAR = vars[
PV->RANS_VAR[v]][I] - vars[
PV->RANS_VAR[v]][IM1];
265 RANSL[v] = vars[
PV->RANS_VAR[v]][I] + DSM * (DSM1 * DQRANSVAR + DS * DQMRANSVAR);
266 RANSR[v] = vars[
PV->RANS_VAR[v]][IP1] - DSP * (DS * DQPRANSVAR + DSP1 * DQRANSVAR);
277 const MFloat FRHOL = F1 / RHOL;
278 const MFloat FRHOR = F1 / RHOR;
280 const MFloat PLfRHOL = PL / RHOL;
281 const MFloat PRfRHOR = PR / RHOR;
282 const MFloat e0 = (rans2eq_production_mode)
283 ? PLfRHOL * FgammaMinusOne + 0.5 * (
POW2(UL) +
POW2(VL)) + RANSL[0] + PLfRHOL
284 : PLfRHOL * FgammaMinusOne + 0.5 * (
POW2(UL) +
POW2(VL)) + PLfRHOL;
285 const MFloat e1 = (rans2eq_production_mode)
286 ? PRfRHOR * FgammaMinusOne + 0.5 * (
POW2(UR) +
POW2(VR)) + RANSR[0] + PRfRHOR
287 : PRfRHOR * FgammaMinusOne + 0.5 * (
POW2(UR) +
POW2(VR)) + PRfRHOR;
292 const MFloat FDGRAD = F1 / DGRAD;
295 const MFloat UUL = ((UL * surf0 + VL * surf1)) * FDGRAD;
296 const MFloat UUR = ((UR * surf0 + VR * surf1)) * FDGRAD;
301 const MFloat FALR = 2.0 / (AL + AR);
302 const MFloat ALPHAL = AL * FALR;
303 const MFloat ALPHAR = AR * FALR;
305 AL = sqrt(gamma * AL);
306 AR = sqrt(gamma * AR);
310 const MFloat XMAL = UUL / AL;
311 const MFloat XMAR = UUR / AR;
316 const MFloat RHOAL = AL * RHOL;
317 const MFloat RHOAR = AR * RHOR;
323 const MFloat SV1 = F1 * SV * DXDXEZ;
324 const MFloat SV2 = F1 * SV * DYDXEZ;
329 MFloat FXMA = F1B2 * (XMAL1 + fabs(XMAL1));
330 const MFloat XMALP = ALPHAL * (F1B4 *
POW2(XMAL1 + F1) - FXMA) + FXMA + (
mMax(F1, XMAL) - F1);
331 FXMA = F1B2 * (XMAR1 - fabs(XMAR1));
332 const MFloat XMARM = ALPHAR * (-F1B4 *
POW2(XMAR1 - F1) - FXMA) + FXMA + (
mMin(-F1, XMAR) + F1);
334 const MFloat FLP = PL * ((F2 - XMAL1) *
POW2(F1 + XMAL1));
335 const MFloat FRP = PR * ((F2 + XMAR1) *
POW2(F1 - XMAR1));
336 const MFloat PLR = F1B4 * (FLP + FRP);
338 const MFloat RHOUL = XMALP * RHOAL;
339 const MFloat RHOUR = XMARM * RHOAR;
340 const MFloat RHOU = RHOUL + RHOUR;
341 const MFloat RHOU2 = F1B2 * RHOU;
342 const MFloat ARHOU2 = fabs(RHOU2);
344 const MFloat UUL2 = SV1 * UUL;
345 const MFloat UUR2 = SV1 * UUR;
348 const MFloat UUL3 = SV2 * UUL;
349 const MFloat UUR3 = SV2 * UUR;
353 flux[
CV->RHO_U][I] = RHOU2 * (UL + UR) + ARHOU2 * (UL - UR) + PLR * surf0 + RHOUL * UUL2 + RHOUR * UUR2;
354 flux[
CV->RHO_V][I] = RHOU2 * (VL + VR) + ARHOU2 * (VL - VR) + PLR * surf1 + RHOUL * UUL3 + RHOUR * UUR3;
355 flux[
CV->RHO_E][I] = RHOU2 * (e0 + e1) + ARHOU2 * (e0 - e1);
356 flux[
CV->RHO][I] = RHOU;
357 for(
MInt v = 0; v < noRANS; ++v) {
358 flux[
CV->RANS_VAR[v]][I] = RHOU2 * (RANSL[v] + RANSR[v]) + ARHOU2 * (RANSL[v] - RANSR[v]);
365 for(
MUint v = 0; v < noVars; v++) {
369 const MInt IM1 = I - IJ[dim];
370 const MUint offset = v * noCells;
371 MFloat*
const RESTRICT rhs = ALIGNED_F(cellRhs + offset);
372 rhs[I] += flux[v][IM1] - flux[v][I];
378template void FvStructuredSolver2DRans::Muscl_AusmDV<5, 1>();
379template void FvStructuredSolver2DRans::Muscl_AusmDV<6, 1>();
380template void FvStructuredSolver2DRans::Muscl_AusmDV<7, 1>();
381template void FvStructuredSolver2DRans::Muscl_AusmDV<6, 2>();
382template void FvStructuredSolver2DRans::Muscl_AusmDV<7, 2>();
385template <MInt noVars, MInt noRANS, MBool rans2eq_production_mode>
402 const MFloat EPSLIM = 1e-14;
403 const MFloat EPSS = 1e-34;
406 const MFloat gammaMinusOne = gamma - 1.0;
407 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
416 for(
MInt dim = 0; dim <
nDim; dim++) {
418#pragma omp parallel for
420 for(
MInt j = 0; j < noCellsJP1; j++) {
421 for(
MInt i = 0; i < noCellsIP1; i++) {
423 const MInt IP1 = I + IJ[dim];
424 dss[dim][I] = sqrt(
POW2(x[IP1] - x[I]) +
POW2(
y[IP1] -
y[I]));
432 for(
MInt dim = 0; dim <
nDim; dim++) {
433 for(
MInt j = 1; j < noCellsJP1; j++) {
434 for(
MInt i = 1; i < noCellsIP1; i++) {
436 const MInt IP1 = I + IJ[dim];
437 const MInt IM1 = I - IJ[dim];
439 const MFloat DS = dss[dim][I];
440 const MFloat DSL = dss[dim][IM1];
441 const MFloat DSR = dss[dim][I];
442 const MFloat FDS = DS /
POW2(DSL + DSR) * 2.0;
446 const MFloat DQLU = DSL * (vars[
PV->U][IP1] - vars[
PV->U][I]);
447 const MFloat DQRU = DSR * (vars[
PV->U][I] - vars[
PV->U][IM1]);
449 ql[
PV->U][I] = vars[
PV->U][I] + FDS * (DQLU + DQRU) * PHIU;
450 qr[
PV->U][IM1] = vars[
PV->U][I] - FDS * (DQLU + DQRU) * PHIU;
452 const MFloat DQLV = DSL * (vars[
PV->V][IP1] - vars[
PV->V][I]);
453 const MFloat DQRV = DSR * (vars[
PV->V][I] - vars[
PV->V][IM1]);
455 ql[
PV->V][I] = vars[
PV->V][I] + FDS * (DQLV + DQRV) * PHIV;
456 qr[
PV->V][IM1] = vars[
PV->V][I] - FDS * (DQLV + DQRV) * PHIV;
458 const MFloat DQLP = DSL * (vars[
PV->P][IP1] - vars[
PV->P][I]);
459 const MFloat DQRP = DSR * (vars[
PV->P][I] - vars[
PV->P][IM1]);
461 ql[
PV->P][I] = vars[
PV->P][I] + FDS * (DQLP + DQRP) * PHIP;
462 qr[
PV->P][IM1] = vars[
PV->P][I] - FDS * (DQLP + DQRP) * PHIP;
464 const MFloat DQLRHO = DSL * (vars[
PV->RHO][IP1] - vars[
PV->RHO][I]);
465 const MFloat DQRRHO = DSR * (vars[
PV->RHO][I] - vars[
PV->RHO][IM1]);
467 mMax(F0, DQLRHO * DQRRHO / (
POW2(DQLRHO) +
POW2(DQRRHO) + EPSLIM *
mMax(EPSS, DSL * DSR)));
468 ql[
PV->RHO][I] = vars[
PV->RHO][I] + FDS * (DQLRHO + DQRRHO) * PHIRHO;
469 qr[
PV->RHO][IM1] = vars[
PV->RHO][I] - FDS * (DQLRHO + DQRRHO) * PHIRHO;
471 for(
MInt v = 0; v < noRANS; ++v) {
472 const MFloat DQLRANSVAR = DSL * (vars[
PV->RANS_VAR[v]][IP1] - vars[
PV->RANS_VAR[v]][I]);
473 const MFloat DQRRANSVAR = DSR * (vars[
PV->RANS_VAR[v]][I] - vars[
PV->RANS_VAR[v]][IM1]);
475 F0, DQLRANSVAR * DQRRANSVAR / (
POW2(DQLRANSVAR) +
POW2(DQRRANSVAR) + EPSLIM *
mMax(EPSS, DSL * DSR)));
476 ql[
PV->RANS_VAR[v]][I] = vars[
PV->RANS_VAR[v]][I] + FDS * (DQLRANSVAR + DQRRANSVAR) * PHIRANSVAR;
477 qr[
PV->RANS_VAR[v]][IM1] = vars[
PV->RANS_VAR[v]][I] - FDS * (DQLRANSVAR + DQRRANSVAR) * PHIRANSVAR;
483 for(
MInt j = 1; j < noCellsJ; j++) {
484 for(
MInt i = 1; i < noCellsI; i++) {
486 const MInt IP1 = I + IJ[dim];
502 for(
MInt v = 0; v < noRANS; ++v) {
503 RANSL[v] = ql[
PV->RANS_VAR[v]][I];
504 RANSR[v] = qr[
PV->RANS_VAR[v]][I];
510 const MFloat FRHOL = F1 / RHOL;
511 const MFloat FRHOR = F1 / RHOR;
513 const MFloat PLfRHOL = PL / RHOL;
514 const MFloat PRfRHOR = PR / RHOR;
515 const MFloat e0 = (rans2eq_production_mode)
516 ? PLfRHOL * FgammaMinusOne + 0.5 * (
POW2(UL) +
POW2(VL)) + RANSL[0] + PLfRHOL
517 : PLfRHOL * FgammaMinusOne + 0.5 * (
POW2(UL) +
POW2(VL)) + PLfRHOL;
518 const MFloat e1 = (rans2eq_production_mode)
519 ? PRfRHOR * FgammaMinusOne + 0.5 * (
POW2(UR) +
POW2(VR)) + RANSR[0] + PRfRHOR
520 : PRfRHOR * FgammaMinusOne + 0.5 * (
POW2(UR) +
POW2(VR)) + PRfRHOR;
525 const MFloat FDGRAD = F1 / DGRAD;
528 const MFloat UUL = ((UL * surf0 + VL * surf1)) * FDGRAD;
529 const MFloat UUR = ((UR * surf0 + VR * surf1)) * FDGRAD;
534 const MFloat FALR = 2.0 / (AL + AR);
535 const MFloat ALPHAL = AL * FALR;
536 const MFloat ALPHAR = AR * FALR;
538 AL = sqrt(gamma * AL);
539 AR = sqrt(gamma * AR);
543 const MFloat XMAL = UUL / AL;
544 const MFloat XMAR = UUR / AR;
549 const MFloat RHOAL = AL * RHOL;
550 const MFloat RHOAR = AR * RHOR;
556 const MFloat SV1 = F1 * SV * DXDXEZ;
557 const MFloat SV2 = F1 * SV * DYDXEZ;
562 MFloat FXMA = F1B2 * (XMAL1 + fabs(XMAL1));
563 const MFloat XMALP = ALPHAL * (F1B4 *
POW2(XMAL1 + F1) - FXMA) + FXMA + (
mMax(F1, XMAL) - F1);
564 FXMA = F1B2 * (XMAR1 - fabs(XMAR1));
565 const MFloat XMARM = ALPHAR * (-F1B4 *
POW2(XMAR1 - F1) - FXMA) + FXMA + (
mMin(-F1, XMAR) + F1);
567 const MFloat FLP = PL * ((F2 - XMAL1) *
POW2(F1 + XMAL1));
568 const MFloat FRP = PR * ((F2 + XMAR1) *
POW2(F1 - XMAR1));
569 const MFloat PLR = F1B4 * (FLP + FRP);
571 const MFloat RHOUL = XMALP * RHOAL;
572 const MFloat RHOUR = XMARM * RHOAR;
573 const MFloat RHOU = RHOUL + RHOUR;
574 const MFloat RHOU2 = F1B2 * RHOU;
575 const MFloat ARHOU2 = fabs(RHOU2);
577 const MFloat UUL2 = SV1 * UUL;
578 const MFloat UUR2 = SV1 * UUR;
581 const MFloat UUL3 = SV2 * UUL;
582 const MFloat UUR3 = SV2 * UUR;
586 flux[
CV->RHO_U][I] = RHOU2 * (UL + UR) + ARHOU2 * (UL - UR) + PLR * surf0 + RHOUL * UUL2 + RHOUR * UUR2;
587 flux[
CV->RHO_V][I] = RHOU2 * (VL + VR) + ARHOU2 * (VL - VR) + PLR * surf1 + RHOUL * UUL3 + RHOUR * UUR3;
588 flux[
CV->RHO_E][I] = RHOU2 * (e0 + e1) + ARHOU2 * (e0 - e1);
589 flux[
CV->RHO][I] = RHOU;
590 for(
MInt v = 0; v < noRANS; ++v) {
591 flux[
CV->RANS_VAR[v]][I] = RHOU2 * (RANSL[v] + RANSR[v]) + ARHOU2 * (RANSL[v] - RANSR[v]);
597 for(
MUint v = 0; v < noVars; v++) {
601 const MInt IM1 = I - IJ[dim];
602 const MUint offset = v * noCells;
603 MFloat*
const RESTRICT rhs = ALIGNED_F(cellRhs + offset);
604 rhs[I] += flux[v][IM1] - flux[v][I];
610template void FvStructuredSolver2DRans::Muscl_AusmDV_Limited<6, 2>();
611template void FvStructuredSolver2DRans::Muscl_AusmDV_Limited<7, 2>();
614template <MInt noVars, MInt noRANS, MBool rans2eq_production_mode>
631 const MFloat EPSLIM = 1e-14;
632 const MFloat EPSS = 1e-34;
635 const MFloat gammaMinusOne = gamma - 1.0;
636 const MFloat FgammaMinusOne = F1 / gammaMinusOne;
645 for(
MInt dim = 0; dim <
nDim; dim++) {
647#pragma omp parallel for
649 for(
MInt j = 0; j < noCellsJP1; j++) {
650 for(
MInt i = 0; i < noCellsIP1; i++) {
652 const MInt IP1 = I + IJ[dim];
653 dss[dim][I] = sqrt(
POW2(x[IP1] - x[I]) +
POW2(
y[IP1] -
y[I]));
661 for(
MInt dim = 0; dim <
nDim; dim++) {
662 for(
MInt j = 1; j < noCellsJP1; j++) {
663 for(
MInt i = 1; i < noCellsIP1; i++) {
665 const MInt IP1 = I + IJ[dim];
666 const MInt IM1 = I - IJ[dim];
668 const MFloat DS = dss[dim][I];
669 const MFloat DSL = dss[dim][IM1];
670 const MFloat DSR = dss[dim][I];
671 const MFloat FDS = DS /
POW2(DSL + DSR) * 2.0;
675 const MFloat DQLU = DSL * (vars[
PV->U][IP1] - vars[
PV->U][I]);
676 const MFloat DQRU = DSR * (vars[
PV->U][I] - vars[
PV->U][IM1]);
678 ql[
PV->U][I] = vars[
PV->U][I] + FDS * (DQLU + DQRU) * PHIU;
679 qr[
PV->U][IM1] = vars[
PV->U][I] - FDS * (DQLU + DQRU) * PHIU;
681 const MFloat DQLV = DSL * (vars[
PV->V][IP1] - vars[
PV->V][I]);
682 const MFloat DQRV = DSR * (vars[
PV->V][I] - vars[
PV->V][IM1]);
684 ql[
PV->V][I] = vars[
PV->V][I] + FDS * (DQLV + DQRV) * PHIV;
685 qr[
PV->V][IM1] = vars[
PV->V][I] - FDS * (DQLV + DQRV) * PHIV;
687 const MFloat DQLP = DSL * (vars[
PV->P][IP1] - vars[
PV->P][I]);
688 const MFloat DQRP = DSR * (vars[
PV->P][I] - vars[
PV->P][IM1]);
690 ql[
PV->P][I] = vars[
PV->P][I] + FDS * (DQLP + DQRP) * PHIP;
691 qr[
PV->P][IM1] = vars[
PV->P][I] - FDS * (DQLP + DQRP) * PHIP;
693 const MFloat DQLRHO = DSL * (vars[
PV->RHO][IP1] - vars[
PV->RHO][I]);
694 const MFloat DQRRHO = DSR * (vars[
PV->RHO][I] - vars[
PV->RHO][IM1]);
696 mMax(F0, DQLRHO * DQRRHO / (
POW2(DQLRHO) +
POW2(DQRRHO) + EPSLIM *
mMax(EPSS, DSL * DSR)));
697 ql[
PV->RHO][I] = vars[
PV->RHO][I] + FDS * (DQLRHO + DQRRHO) * PHIRHO;
698 qr[
PV->RHO][IM1] = vars[
PV->RHO][I] - FDS * (DQLRHO + DQRRHO) * PHIRHO;
700 for(
MInt v = 0; v < noRANS; ++v) {
701 const MFloat DQLRANSVAR = DSL * (vars[
PV->RANS_VAR[v]][IP1] - vars[
PV->RANS_VAR[v]][I]);
702 const MFloat DQRRANSVAR = DSR * (vars[
PV->RANS_VAR[v]][I] - vars[
PV->RANS_VAR[v]][IM1]);
704 F0, DQLRANSVAR * DQRRANSVAR / (
POW2(DQLRANSVAR) +
POW2(DQRRANSVAR) + EPSLIM *
mMax(EPSS, DSL * DSR)));
705 ql[
PV->RANS_VAR[v]][I] = vars[
PV->RANS_VAR[v]][I] + FDS * (DQLRANSVAR + DQRRANSVAR) * PHIRANSVAR;
706 qr[
PV->RANS_VAR[v]][IM1] = vars[
PV->RANS_VAR[v]][I] - FDS * (DQLRANSVAR + DQRRANSVAR) * PHIRANSVAR;
712 for(
MInt j = 1; j < noCellsJ; j++) {
713 for(
MInt i = 1; i < noCellsI; i++) {
730 for(
MInt v = 0; v < noRANS; ++v) {
731 RANSL[v] = ql[
PV->RANS_VAR[v]][I];
732 RANSR[v] = qr[
PV->RANS_VAR[v]][I];
740 const MFloat FDGRAD = F1 / DGRAD;
743 const MFloat UUL = ((UL * surf0 + VL * surf1)) * FDGRAD;
746 const MFloat UUR = ((UR * surf0 + VR * surf1)) * FDGRAD;
752 const MFloat MAL = UUL / AL;
753 const MFloat MAR = UUR / AR;
755 const MFloat MALR = F1B2 * (MAL + MAR);
756 const MFloat PLR = F1B2 * (PL + PR);
758 const MFloat RHO_AL = RHOL * AL;
759 const MFloat RHO_AR = RHOR * AR;
761 const MFloat PLfRHOL = PL / RHOL;
762 const MFloat PRfRHOR = PR / RHOR;
763 const MFloat e0 = (rans2eq_production_mode)
764 ? PLfRHOL * FgammaMinusOne + 0.5 * (
POW2(UL) +
POW2(VL)) + RANSL[0] + PLfRHOL
765 : PLfRHOL * FgammaMinusOne + 0.5 * (
POW2(UL) +
POW2(VL)) + PLfRHOL;
766 const MFloat e1 = (rans2eq_production_mode)
767 ? PRfRHOR * FgammaMinusOne + 0.5 * (
POW2(UR) +
POW2(VR)) + RANSR[0] + PRfRHOR
768 : PRfRHOR * FgammaMinusOne + 0.5 * (
POW2(UR) +
POW2(VR)) + PRfRHOR;
770 const MFloat RHOU = F1B2 * (MALR * (RHO_AL + RHO_AR) + fabs(MALR) * (RHO_AL - RHO_AR)) * DGRAD;
771 const MFloat RHOU2 = F1B2 * RHOU;
772 const MFloat ARHOU2 = fabs(RHOU2);
774 flux[
CV->RHO_U][I] = RHOU2 * (UL + UR) + ARHOU2 * (UL - UR) + PLR * surf0;
775 flux[
CV->RHO_V][I] = RHOU2 * (VL + VR) + ARHOU2 * (VL - VR) + PLR * surf1;
776 flux[
CV->RHO_E][I] = RHOU2 * (e0 + e1) + ARHOU2 * (e0 - e1);
777 flux[
CV->RHO][I] = RHOU;
778 for(
MInt v = 0; v < noRANS; ++v) {
779 flux[
CV->RANS_VAR[v]][I] = RHOU2 * (RANSL[v] + RANSR[v]) + ARHOU2 * (RANSL[v] - RANSR[v]);
785 for(
MUint v = 0; v < noVars; v++) {
789 const MInt IM1 = I - IJ[dim];
790 const MUint offset = v * noCells;
791 MFloat*
const RESTRICT rhs = ALIGNED_F(cellRhs + offset);
792 rhs[I] += flux[v][IM1] - flux[v][I];
798template void FvStructuredSolver2DRans::Muscl_Ausm_Limited<6, 2>();
799template void FvStructuredSolver2DRans::Muscl_Ausm_Limited<7, 2>();
840 const MFloat dnutdxi = F1B2 * (nuTilde[IPJP] + nuTilde[IPJ] - nuTilde[IJP] - nuTilde[IJ]);
841 const MFloat dnutdet = F1B2 * (nuTilde[IPJP] + nuTilde[IJP] - nuTilde[IPJ] - nuTilde[IJ]);
843 const MFloat nutldAvg = F1B4 * (nuTilde[IJP] + nuTilde[IPJP] + nuTilde[IJ] + nuTilde[IPJ]);
846 F1B4 * (muLam[IJP] / rho[IJP] + muLam[IPJP] / rho[IPJP] + muLam[IJ] / rho[IJ] + muLam[IPJ] / rho[IPJ]);
859 * (dnutldx * cornerMetrics[
xsd * 2 +
xsd] + dnutldy * cornerMetrics[
xsd * 2 +
ysd]);
863 * (dnutldx * cornerMetrics[
ysd * 2 +
xsd] + dnutldy * cornerMetrics[
ysd * 2 +
ysd]);
869 const MFloat du1 = u[IPJ] - u[IMJ];
870 const MFloat du2 = u[IJP] - u[IJM];
871 const MFloat dv1 = v[IPJ] - v[IMJ];
872 const MFloat dv2 = v[IJP] - v[IJM];
880 const MFloat Fdist2 = 1.0 / (distance * distance);
881 const MFloat chi = nuTilde[IJ] * rho[IJ] / (SUTHERLANDLAW(T[IJ]));
882 const MFloat chip3 = chi * chi * chi;
884 const MFloat Fv2 = F1 - (chi / (F1 + chi * Fv1));
887 const MFloat stilde = s + term * Fv2 * rRe;
888 const MFloat r = min(10.0, rRe * term / stilde);
892 const MFloat Fw = g * pow(Fwterm, (1.0 / 6.0));
895 * pow(nuTilde[IJ], 2.0) * Fdist2;
915 sa_1flux[0][IJ] = F1B2 * (eflux[0][IJ] + eflux[0][IJM]);
916 sa_2flux[0][IJ] = F1B2 * (eflux[1][IJ] + eflux[1][IJM]);
925 sa_1flux[1][IJ] = F1B2 * (fflux[0][IJ] + fflux[0][IMJ]);
926 sa_2flux[1][IJ] = F1B2 * (fflux[1][IJ] + fflux[1][IMJ]);
938 const MFloat dissipation_term =
939 (((sa_1flux[0][IJ] - sa_1flux[0][IMJ]) + ((sa_2flux[0][IJ] - sa_2flux[0][IMJ]) * nuTilde[IJ])) * rho[IJ]
941 + ((sa_1flux[1][IJ] - sa_1flux[1][IJM]) + ((sa_2flux[1][IJ] - sa_2flux[1][IJM]) * nuTilde[IJ])) * rho[IJ]
967 static constexpr MFloat minMFloat =
1005 const MFloat dTKEdxi = F1B2 * (TKE[IPJP] + TKE[IPJ] - TKE[IJP] - TKE[IJ]);
1006 const MFloat dTKEdet = F1B2 * (TKE[IPJP] + TKE[IJP] - TKE[IPJ] - TKE[IJ]);
1008 const MFloat dTKEdx = dTKEdxi * cornerMetrics[
xsd * 2 +
xsd] + dTKEdet * cornerMetrics[
ysd * 2 +
xsd];
1010 const MFloat dTKEdy = dTKEdxi * cornerMetrics[
xsd * 2 +
ysd] + dTKEdet * cornerMetrics[
ysd * 2 +
ysd];
1013 const MFloat depsdxi = F1B2 * (eps[IPJP] + eps[IPJ] - eps[IJP] - eps[IJ]);
1014 const MFloat depsdet = F1B2 * (eps[IPJP] + eps[IJP] - eps[IPJ] - eps[IJ]);
1016 const MFloat depsdx = depsdxi * cornerMetrics[
xsd * 2 +
xsd] + depsdet * cornerMetrics[
ysd * 2 +
xsd];
1018 const MFloat depsdy = depsdxi * cornerMetrics[
xsd * 2 +
ysd] + depsdet * cornerMetrics[
ysd * 2 +
ysd];
1021 const MFloat muLamAvg = F1B4 * (muLam[IJP] + muLam[IPJP] + muLam[IJ] + muLam[IPJ]);
1022 const MFloat muTurbAvg = F1B4 * (muTurb[IJP] + muTurb[IPJP] + muTurb[IJ] + muTurb[IPJ]);
1028 const MFloat sax1 = Frj * mu_k * (dTKEdx * cornerMetrics[
xsd * 2 +
xsd] + dTKEdy * cornerMetrics[
xsd * 2 +
ysd]);
1030 Frj * mu_eps * (depsdx * cornerMetrics[
xsd * 2 +
xsd] + depsdy * cornerMetrics[
xsd * 2 +
ysd]);
1031 const MFloat say1 = Frj * mu_k * (dTKEdx * cornerMetrics[
ysd * 2 +
xsd] + dTKEdy * cornerMetrics[
ysd * 2 +
ysd]);
1033 Frj * mu_eps * (depsdx * cornerMetrics[
ysd * 2 +
xsd] + depsdy * cornerMetrics[
ysd * 2 +
ysd]);
1035 eflux[0][IJ] = sax1;
1036 eflux[1][IJ] = sax2;
1038 fflux[0][IJ] = say1;
1039 fflux[1][IJ] = say2;
1051 sa_1flux[0][IJ] = F1B2 * (eflux[0][IJ] + eflux[0][IJM]);
1052 sa_2flux[0][IJ] = F1B2 * (eflux[1][IJ] + eflux[1][IJM]);
1061 sa_1flux[1][IJ] = F1B2 * (fflux[0][IJ] + fflux[0][IMJ]);
1062 sa_2flux[1][IJ] = F1B2 * (fflux[1][IJ] + fflux[1][IMJ]);
1078 const MFloat diffusion_TKE = (sa_1flux[0][IJ] - sa_1flux[0][IMJ]) + (sa_1flux[1][IJ] - sa_1flux[1][IJM]);
1080 const MFloat diffusion_eps = (sa_2flux[0][IJ] - sa_2flux[0][IMJ]) + (sa_2flux[1][IJ] - sa_2flux[1][IJM]);
1088 const MFloat dudxi = 0.5 * (u[IPJ] - u[IMJ]);
1089 const MFloat dudet = 0.5 * (u[IJP] - u[IJM]);
1090 const MFloat dvdxi = 0.5 * (v[IPJ] - v[IMJ]);
1091 const MFloat dvdet = 0.5 * (v[IJP] - v[IJM]);
1104 const MFloat P = ((rRe0 /
POW2(fac_nonDim)) * invCellJac * muTurb[IJ]
1105 * (2.0 *
POW2(dudx) + 2.0 *
POW2(dvdy) +
POW2(dudy + dvdx) - fac * F2B3 *
POW2(dudx + dvdy))
1106 - fac * F2B3 * rho[IJ] * TKE[IJ] * (dudx + dvdy))
1111 fac_nonDim *
m_solver->
m_Re0 * rho[IJ] *
POW2(TKE[IJ]) / muLam[IJ] / std::max(eps[IJ], minMFloat);
1112 const MFloat f2 = 1 - 0.222222222222222 * exp(-
POW2(Ret) * 0.027777777777777777 );
1114 const MFloat Mt2 = 1.5 * TKE[IJ] * rho[IJ] / (gamma * p[IJ]);
1115 const MFloat Fdist2 = 1.0 /
POW2(wallDist[IJ]);
1116 const MFloat k_diss1 = fac_nonDim * rho[IJ] * eps[IJ] * (1 + Mt2);
1117 const MFloat k_diss2 = 2.0 * rRe0 * muLam[IJ] * TKE[IJ] * Fdist2;
1121 const MFloat yp = utau[IJ] * wallDist[IJ];
1128 const MFloat invRhoEps = 1.0 / (rho[IJ] * eps[IJ]);
1131 + fac_nonDim * (1 + Mt2);
1132 const MFloat f2_limit = (RHS1 + k_diss2 * invRhoEps * (1 - exp_wall)) / (fac_nonDim *
RM_KEPS::C2);
1133 f2_ = std::min(1.0, std::max(f2, f2_limit));
1134 const MFloat diff = std::max(0.0, f2_limit - 1.0);
1135 f3 = std::max(0.0, 1.0 - fac_nonDim *
RM_KEPS::C2 * diff / (k_diss2 * invRhoEps * (1 - exp_wall)));
1138 const MFloat k_diss = k_diss1 + f3 * k_diss2;
1139 const MFloat eps_diss = tau * (fac_nonDim *
RM_KEPS::C2 * f2_ * rho[IJ] * eps[IJ] + f3 * k_diss2 * exp_wall);
1164 static constexpr MFloat minMFloat =
1203 const MFloat dTKEdxi = F1B2 * (TKE[IPJP] + TKE[IPJ] - TKE[IJP] - TKE[IJ]);
1204 const MFloat dTKEdet = F1B2 * (TKE[IPJP] + TKE[IJP] - TKE[IPJ] - TKE[IJ]);
1206 const MFloat depsdxi = F1B2 * (eps[IPJP] + eps[IPJ] - eps[IJP] - eps[IJ]);
1207 const MFloat depsdet = F1B2 * (eps[IPJP] + eps[IJP] - eps[IPJ] - eps[IJ]);
1209 const MFloat metricTerms = cornerMetrics[
xsd * 2 +
xsd] * cornerMetrics[
ysd * 2 +
xsd]
1210 + cornerMetrics[
xsd * 2 +
ysd] * cornerMetrics[
ysd * 2 +
ysd];
1214 const MFloat sax1 = invCornerJac * dTKEdet * metricTerms;
1215 const MFloat sax2 = invCornerJac * depsdet * metricTerms;
1216 const MFloat say1 = invCornerJac * dTKEdxi * metricTerms;
1217 const MFloat say2 = invCornerJac * depsdxi * metricTerms;
1219 eflux[0][IJ] = sax1;
1220 eflux[1][IJ] = sax2;
1222 fflux[0][IJ] = say1;
1223 fflux[1][IJ] = say2;
1229 const MFloat dudxi = F1B2 * (u[IPJP] + u[IPJ] - u[IJP] - u[IJ]);
1230 const MFloat dudet = F1B2 * (u[IPJP] + u[IJP] - u[IPJ] - u[IJ]);
1232 const MFloat dvdxi = F1B2 * (v[IPJP] + v[IPJ] - v[IJP] - v[IJ]);
1233 const MFloat dvdet = F1B2 * (v[IPJP] + v[IJP] - v[IPJ] - v[IJ]);
1235 const MFloat S11 = dudxi * cornerMetrics[
xsd * 2 +
xsd] + dudet * cornerMetrics[
ysd * 2 +
xsd];
1237 * (dudxi * cornerMetrics[
xsd * 2 +
ysd] + dudet * cornerMetrics[
ysd * 2 +
ysd]
1238 + dvdxi * cornerMetrics[
xsd * 2 +
xsd] + dvdet * cornerMetrics[
ysd * 2 +
xsd]);
1239 const MFloat S22 = dvdxi * cornerMetrics[
xsd * 2 +
ysd] + dvdet * cornerMetrics[
ysd * 2 +
ysd];
1240 const MFloat S = S11 * S11 + 2 * S12 * S12 + S22 * S22;
1242 const MFloat muTurbAvg = F1B4 * (muTurb[IJP] + muTurb[IPJP] + muTurb[IJ] + muTurb[IPJ]);
1247 const MFloat mueOverRe = rRe0 * invCornerJac * muTurbAvg /
POW2(fac_nonDim);
1272 const MFloat dTKEdxi = TKE[IPJ] - TKE[IJ];
1273 const MFloat depsdxi = eps[IPJ] - eps[IJ];
1275 const MFloat muLamAvg_xi = F1B2 * (muLam[IJ] + muLam[IPJ]);
1276 const MFloat muTurbAvg_xi = F1B2 * (muTurb[IJ] + muTurb[IPJ]);
1282 const MFloat Frj = rRe0 * surfJac;
1289 MFloat limiterVisc1 = 1.0;
1290 MFloat limiterVisc2 = 1.0;
1294 limiterVisc1 = std::min(1.0, mu_ref / std::abs(rRe0 * mu_k_xi));
1295 limiterVisc2 = std::min(1.0, mu_ref / std::abs(rRe0 * mu_eps_xi));
1298 sa_1flux[0][IJ] = Frj * mu_k_xi * (temp_TKE + F1B2 * (eflux[0][IJ] + eflux[0][IJM])) * limiterVisc1;
1299 sa_2flux[0][IJ] = Frj * mu_eps_xi * (temp_eps + F1B2 * (eflux[1][IJ] + eflux[1][IJM])) * limiterVisc2;
1311 const MFloat dTKEdet = TKE[IJP] - TKE[IJ];
1312 const MFloat depsdet = eps[IJP] - eps[IJ];
1314 const MFloat muLamAvg_eta = F1B2 * (muLam[IJ] + muLam[IJP]);
1315 const MFloat muTurbAvg_eta = F1B2 * (muTurb[IJ] + muTurb[IJP]);
1331 const MFloat Frj = rRe0 * surfJac;
1338 MFloat limiterVisc1 = 1.0;
1339 MFloat limiterVisc2 = 1.0;
1343 limiterVisc1 = std::min(1.0, mu_ref / std::abs(rRe0 * mu_k_eta));
1344 limiterVisc2 = std::min(1.0, mu_ref / std::abs(rRe0 * mu_eps_eta));
1347 sa_1flux[1][IJ] = Frj * mu_k_eta * (temp_TKE + F1B2 * (fflux[0][IJ] + fflux[0][IMJ])) * limiterVisc1;
1348 sa_2flux[1][IJ] = Frj * mu_eps_eta * (temp_eps + F1B2 * (fflux[1][IJ] + fflux[1][IMJ])) * limiterVisc2;
1368 MFloat limiterVisc1 = 1.0;
1369 MFloat limiterVisc2 = 1.0;
1377 const MFloat diffusion_TKE =
1378 (sa_1flux[0][IJ] - sa_1flux[0][IMJ]) + (sa_1flux[1][IJ] - sa_1flux[1][IJM]) * limiterVisc1;
1380 const MFloat diffusion_eps =
1381 (sa_2flux[0][IJ] - sa_2flux[0][IMJ]) + (sa_2flux[1][IJ] - sa_2flux[1][IJM]) * limiterVisc2;
1394 const MFloat dudxi = 0.5 * (u[IPJ] - u[IMJ]);
1395 const MFloat dudet = 0.5 * (u[IJP] - u[IJM]);
1396 const MFloat dvdxi = 0.5 * (v[IPJ] - v[IMJ]);
1397 const MFloat dvdet = 0.5 * (v[IJP] - v[IJM]);
1410 P = ((rRe0 /
POW2(fac_nonDim)) * invCellJac * muTurb[IJ]
1411 * (2.0 *
POW2(dudx) + 2.0 *
POW2(dvdy) +
POW2(dudy + dvdx) - fac * F2B3 *
POW2(dudx + dvdy))
1412 - fac * F2B3 * rho[IJ] * TKE[IJ] * (dudx + dvdy))
1418 fac_nonDim *
m_solver->
m_Re0 * rho[IJ] *
POW2(TKE[IJ]) / muLam[IJ] / std::max(eps[IJ], minMFloat);
1419 const MFloat f2 = 1 - 0.222222222222222 * exp(-
POW2(Ret) * 0.027777777777777777 );
1421 const MFloat Mt2 = 1.5 * TKE[IJ] * rho[IJ] / (gamma * p[IJ]);
1422 const MFloat Fdist2 = 1.0 /
POW2(wallDist[IJ]);
1423 const MFloat k_diss1 = fac_nonDim * rho[IJ] * eps[IJ] * (1 + Mt2);
1424 const MFloat k_diss2 = 2.0 * rRe0 * muLam[IJ] * TKE[IJ] * Fdist2;
1428 const MFloat yp = utau[IJ] * wallDist[IJ];
1435 const MFloat invRhoEps = 1.0 / std::max(rho[IJ] * eps[IJ], minMFloat);
1439 + fac_nonDim * (1 + Mt2);
1440 const MFloat f2_limit = (RHS1 + k_diss2 * invRhoEps * (1 - exp_wall)) / (fac_nonDim *
RM_KEPS::C2);
1441 f2_ = std::min(1.0, std::max(f2, f2_limit));
1442 const MFloat diff = std::max(0.0, f2_limit - 1.0);
1443 f3 = std::max(0.0, 1.0 - fac_nonDim *
RM_KEPS::C2 * diff / (k_diss2 * invRhoEps * (1 - exp_wall)));
1446 const MFloat k_diss = k_diss1 + f3 * k_diss2;
1447 const MFloat eps_diss = tau * (fac_nonDim *
RM_KEPS::C2 * f2_ * rho[IJ] * eps[IJ] + f3 * k_diss2 * exp_wall);
1490 nuTilde[i] =
mMin(
mMax(nuTilde[i], 0.0), 3000.0);
1494 const MFloat nuLaminar = SUTHERLANDLAW(T[i]) / rho[i];
1495 const MFloat chi = nuTilde[i] / (nuLaminar);
1497 const MFloat nuTurb = fv1 * nuTilde[i];
1506 static constexpr MFloat minMFloat =
1511 static const MFloat sqrtF2B3 = sqrt(2.0) / 3.0;
1521 const MFloat*
const RESTRICT utau2 =
1532 TKE[i] =
PV->ransInfinity[0];
1533 eps[i] =
PV->ransInfinity[1];
1539 muLam[i] = SUTHERLANDLAW(T[i]);
1541 const MFloat yp = utau[i] * wallDist[i];
1547 ? utau2[i] * c_wd_eff * sqrt(Da[i] / por[i])
1550 const MFloat sgn = eps[i] < 0 ? -1.0 : 1.0;
1551 const MFloat eps_i = sgn *
mMax(fabs(eps[i]), minMFloat);
1561 const MFloat dudxi = 0.5 * (u[IPJ] - u[IMJ]);
1562 const MFloat dudet = 0.5 * (u[IJP] - u[IJM]);
1563 const MFloat dvdxi = 0.5 * (v[IPJ] - v[IMJ]);
1564 const MFloat dvdet = 0.5 * (v[IJP] - v[IJM]);
1576 const MFloat S11 = F2B3 * dudx - F1B3 * dvdy;
1577 const MFloat S12 = 0.5 * (dudy + dvdx);
1578 const MFloat S22 = F2B3 * dvdy - F1B3 * dudx;
1579 const MFloat S = sqrt(S11 * S11 + 2 * S12 * S12 + S22 * S22) * invCellJac;
1580 const MFloat temp = sqrtF2B3 / std::max(S, minMFloat);
1581 const MFloat nuTurbMax = temp * fabs(TKE[i]) * Re0 *
POW2(fac_nonDim);
1589 const MFloat nuTurb = sgn * std::min(nuTurbMax, nuTurb_true);
1594 RM_KEPS::C_mu * f_mu * fabs(TKE[i]) * Re0 * fac_nonDim / std::max(fabs(nuTurb), minMFloat);
1628 mTerm(1,
"Either you specify 'anomPoint' and 'anomRadius' or neither of them!");
1635 if(noAnomPoints %
nDim != 0 || noAnomPoints !=
nDim * noAnomRadius)
1636 mTerm(1,
"IQ>10 mandatory for usage of k-epsilon model!!!");
1637 for(
MInt n = 0; n < noAnomRadius; ++n) {
1638 const MFloat rPOW2 =
POW2(Context::getSolverProperty<MFloat>(
"anomRadius",
m_solverId, AT_, n));
1640 Context::getSolverProperty<MFloat>(
"anomPoint",
m_solverId, AT_, n *
nDim + 1)};
1666 if(singularity[i].BC == -6000) {
1669 len1[j] = singularity[i].
end[j] - singularity[i].start[j];
1674 if(singularity[i].end[n] - singularity[i].start[n] > 1) {
1675 mTerm(1,
"In 2D not possible!");
1678 start[n] = singularity[i].start[n] + 1;
1679 end[n] = singularity[i].end[n] - 1;
1681 start[n] = singularity[i].start[n];
1682 end[n] = singularity[i].end[n];
1687 MFloat TKEcorner, EPScorner;
1688 for(
MInt jj = start[1]; jj < end[1]; ++jj) {
1689 for(
MInt ii = start[0]; ii < end[0]; ++ii) {
1693 const MInt IJ_ =
cellIndex(ii + singularity[i].Viscous[0], jj + singularity[i].Viscous[1]);
1702 nghbr[count++] = IJ;
1712 for(
MInt m = 0; m < singularity[i].Nstar - 1; ++m) {
1713 MInt* change = singularity[i].displacement[m];
1714 nghbr[count++] =
cellIndex(ii + change[0], jj + change[1]);
1718 if(count != singularity[i].Nstar) {
1719 cout <<
"what the hell! it is wrong!!!" << endl;
1722 for(
MInt m = 0; m < singularity[i].Nstar; ++m) {
1723 TKE[m] = TKE_[nghbr[m]];
1724 EPS[m] = EPS_[nghbr[m]];
1730 MInt id2 = ii - start[0] + (jj - start[1]) * len1[0];
1732 for(
MInt n = 0; n < count; n++) {
1733 MInt ID = id2 * count + n;
1734 TKEcorner += singularity[i].ReconstructionConstants[0][ID] * TKE[n];
1735 EPScorner += singularity[i].ReconstructionConstants[0][ID] * EPS[n];
1738 const MInt sign_xi = 2 * singularity[i].Viscous[0] + 1;
1739 const MInt sign_eta = 2 * singularity[i].Viscous[1] + 1;
1744 const MFloat dTKEdet = sign_eta * 0.5 * (TKEcorner - 0.5 * (TKE[0] + TKE_[IPMJ]));
1745 const MFloat dEPSdet = sign_eta * 0.5 * (EPScorner - 0.5 * (EPS[0] + EPS_[IPMJ]));
1747 const MFloat dTKEdxi = sign_xi * 0.5 * (TKEcorner - 0.5 * (TKE[0] + TKE_[IJPM]));
1748 const MFloat dEPSdxi = sign_xi * 0.5 * (EPScorner - 0.5 * (EPS[0] + EPS_[IJPM]));
1753 const MFloat metricTerms_xi = surfaceMetrics[
xsd * 2 +
xsd] * surfaceMetricsS[
ysd * 2 +
xsd]
1754 + surfaceMetrics[
xsd * 2 +
ysd] * surfaceMetricsS[
ysd * 2 +
ysd];
1755 const MFloat metricTerms_eta = surfaceMetricsS[
xsd * 2 +
xsd] * surfaceMetrics[
ysd * 2 +
xsd]
1756 + surfaceMetricsS[
xsd * 2 +
ysd] * surfaceMetrics[
ysd * 2 +
ysd];
1761 const MFloat sax1 = invSurfJac_xi * dTKEdet * metricTerms_xi;
1762 const MFloat sax2 = invSurfJac_xi * dEPSdet * metricTerms_xi;
1763 const MFloat say1 = invSurfJac_eta * dTKEdxi * metricTerms_eta;
1764 const MFloat say2 = invSurfJac_eta * dEPSdxi * metricTerms_eta;
1766 eflux[0][IJ_] = sax1;
1767 eflux[1][IJ_] = sax2;
1769 fflux[0][IJ_] = say1;
1770 fflux[1][IJ_] = say2;
1791 return origin + incI + incJ *
m_nCells[1];
1797 const MInt IP1 = I + IJK[dim];
1798 const MInt IM1 = I - IJK[dim];
1799 const MInt IP2 = I + 2 * IJK[dim];
1809 *
mMax(
mMax(fabs((PIM2 - PIM1) /
mMin(PIM2, PIM1)), fabs((PIM1 - PIP1) /
mMin(PIM1, PIP1))),
1810 fabs((PIP1 - PIP2) /
mMin(PIP1, PIP2))));
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
static MInt propertyLength(const MString &name, MInt solverId=m_noSolvers)
Returns the number of elements of a property.
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
2D structured solver class
StructuredBndryCnd< 2 > * m_structuredBndryCnd
void viscousFluxLESCompact()
void setAndAllocate_KEPSILON()
~FvStructuredSolver2DRans()
std::unique_ptr< MConservativeVariables< 2 > > & CV
FvStructuredSolver2DRans(FvStructuredSolver2D *solver)
std::unique_ptr< MPrimitiveVariables< 2 > > & PV
void computeTurbViscosity_KEPSILON()
void viscousFlux_KEPSILON2()
std::unique_ptr< StructuredFQVariables > & FQ
MInt cellIndex(MInt i, MInt j)
void Muscl_AusmDV_Limited()
void computeTurbViscosity()
void computeTurbViscosity_SA()
void diffusiveFluxCorrection()
void(FvStructuredSolver2DRans::* viscFluxMethod)()
MFloat getPSI(MInt, MInt)
void Muscl(MInt timerId=-1)
void Muscl_Ausm_Limited()
FvStructuredSolver2D * m_solver
MInt getCellIdfromCell(MInt origin, MInt incI, MInt incJ)
void viscousFlux_KEPSILON()
void(FvStructuredSolver2DRans::* reconstructSurfaceData)()
static constexpr const MInt nDim
void(FvStructuredSolver2DRans::* compTurbVisc)()
std::unique_ptr< StructuredFQVariables > FQ
SingularInformation * m_singularity
std::unique_ptr< MPrimitiveVariables< nDim > > PV
std::unique_ptr< MConservativeVariables< nDim > > CV
MPI_Comm m_StructuredComm
MFloat m_sutherlandPlusOne
MFloat m_sutherlandConstant
const MInt m_solverId
a unique solver identifier
virtual void computeFrictionCoef()
virtual void distributeWallAndFPProperties()
MFloat ** surfaceMetricsSingularity
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
void mTerm(const MInt errorCode, const MString &location, const MString &message)
constexpr Real POW2(const Real x)
constexpr T mMin(const T &x, const T &y)
constexpr T mMax(const T &x, const T &y)
static constexpr MFloat C1
static constexpr MFloat C2
static constexpr MFloat C3
static constexpr MFloat rsigma_eps
static constexpr MFloat C_mu
static constexpr MFloat C4
static constexpr MFloat rsigma_k
static constexpr MFloat cw1
static constexpr MFloat Fsigma
static constexpr MFloat cv1to3
static constexpr MFloat cw3to6
static constexpr MFloat Ft2
static constexpr MFloat cb2
static constexpr MFloat Fkap2
static constexpr MFloat cw2
static constexpr MFloat cb1