397 {
399 const MFloat epss = 1e-34;
400
402
403
405
406
409
416
420
422
426
431
435
436 const MFloat cellMetrics[9] = {
440
442
443 const MFloat dudxi = fjac * (u[IPJK] - u[IMJK]);
444 const MFloat dudet = fjac * (u[IJPK] - u[IJMK]);
445 const MFloat dudze = fjac * (u[IJKP] - u[IJKM]);
446
447 const MFloat dvdxi = fjac * (v[IPJK] - v[IMJK]);
448 const MFloat dvdet = fjac * (v[IJPK] - v[IJMK]);
449 const MFloat dvdze = fjac * (v[IJKP] - v[IJKM]);
450
451 const MFloat dwdxi = fjac * (w[IPJK] - w[IMJK]);
452 const MFloat dwdet = fjac * (w[IJPK] - w[IJMK]);
453 const MFloat dwdze = fjac * (w[IJKP] - w[IJKM]);
454
455 const MFloat dnutdxi = fjac * (nuTilde[IPJK] - nuTilde[IMJK]);
456 const MFloat dnutdet = fjac * (nuTilde[IJPK] - nuTilde[IJMK]);
457 const MFloat dnutdze = fjac * (nuTilde[IJKP] - nuTilde[IJKM]);
458
459
460 uvwn(IJK, 0, 0) = cellMetrics[0] * dudxi + cellMetrics[3] * dudet + cellMetrics[6] * dudze;
461 uvwn(IJK, 0, 1) = cellMetrics[1] * dudxi + cellMetrics[4] * dudet + cellMetrics[7] * dudze;
462 uvwn(IJK, 0, 2) = cellMetrics[2] * dudxi + cellMetrics[5] * dudet + cellMetrics[8] * dudze;
463
464 uvwn(IJK, 1, 0) = cellMetrics[0] * dvdxi + cellMetrics[3] * dvdet + cellMetrics[6] * dvdze;
465 uvwn(IJK, 1, 1) = cellMetrics[1] * dvdxi + cellMetrics[4] * dvdet + cellMetrics[7] * dvdze;
466 uvwn(IJK, 1, 2) = cellMetrics[2] * dvdxi + cellMetrics[5] * dvdet + cellMetrics[8] * dvdze;
467
468 uvwn(IJK, 2, 0) = cellMetrics[0] * dwdxi + cellMetrics[3] * dwdet + cellMetrics[6] * dwdze;
469 uvwn(IJK, 2, 1) = cellMetrics[1] * dwdxi + cellMetrics[4] * dwdet + cellMetrics[7] * dwdze;
470 uvwn(IJK, 2, 2) = cellMetrics[2] * dwdxi + cellMetrics[5] * dwdet + cellMetrics[8] * dwdze;
471
472 uvwn(IJK, 3, 0) = cellMetrics[0] * dnutdxi + cellMetrics[3] * dnutdet + cellMetrics[6] * dnutdze;
473 uvwn(IJK, 3, 1) = cellMetrics[1] * dnutdxi + cellMetrics[4] * dnutdet + cellMetrics[7] * dnutdze;
474 uvwn(IJK, 3, 2) = cellMetrics[2] * dnutdxi + cellMetrics[5] * dnutdet + cellMetrics[8] * dnutdze;
475 }
476 }
477 }
478
479
480 for(
MInt var = 0; var < 4; var++) {
481
487
488 uvwn(II1, var, 0) = 2.0 * uvwn(II2, var, 0) - uvwn(II3, var, 0);
489 uvwn(II1, var, 1) = 2.0 * uvwn(II2, var, 1) - uvwn(II3, var, 1);
490 uvwn(II1, var, 2) = 2.0 * uvwn(II2, var, 2) - uvwn(II3, var, 2);
491 }
492 }
493
494
500
501 uvwn(II1, var, 0) = 2.0 * uvwn(II2, var, 0) - uvwn(II3, var, 0);
502 uvwn(II1, var, 1) = 2.0 * uvwn(II2, var, 1) - uvwn(II3, var, 1);
503 uvwn(II1, var, 2) = 2.0 * uvwn(II2, var, 2) - uvwn(II3, var, 2);
504 }
505 }
506
507
513
514 uvwn(II1, var, 0) = 2.0 * uvwn(II2, var, 0) - uvwn(II3, var, 0);
515 uvwn(II1, var, 1) = 2.0 * uvwn(II2, var, 1) - uvwn(II3, var, 1);
516 uvwn(II1, var, 2) = 2.0 * uvwn(II2, var, 2) - uvwn(II3, var, 2);
517 }
518 }
519
520
526
527 uvwn(II1, var, 0) = 2.0 * uvwn(II2, var, 0) - uvwn(II3, var, 0);
528 uvwn(II1, var, 1) = 2.0 * uvwn(II2, var, 1) - uvwn(II3, var, 1);
529 uvwn(II1, var, 2) = 2.0 * uvwn(II2, var, 2) - uvwn(II3, var, 2);
530 }
531 }
532
533
534
540
541 uvwn(II1, var, 0) = 2.0 * uvwn(II2, var, 0) - uvwn(II3, var, 0);
542 uvwn(II1, var, 1) = 2.0 * uvwn(II2, var, 1) - uvwn(II3, var, 1);
543 uvwn(II1, var, 2) = 2.0 * uvwn(II2, var, 2) - uvwn(II3, var, 2);
544 }
545 }
546
547
553
554 uvwn(II1, var, 0) = 2.0 * uvwn(II2, var, 0) - uvwn(II3, var, 0);
555 uvwn(II1, var, 1) = 2.0 * uvwn(II2, var, 1) - uvwn(II3, var, 1);
556 uvwn(II1, var, 2) = 2.0 * uvwn(II2, var, 2) - uvwn(II3, var, 2);
557 }
558 }
559 }
560
563 omega.fill(0.0);
564 dumm.fill(0.0);
565
572 const MFloat Sij = F1B2 * (uvwn(IJK, i, j) + uvwn(IJK, j, i));
573 dumm(IJK) += Sij * Sij;
574 }
575 }
576 }
577 }
578 }
579
581
586 omega(IJK) =
mMax(eps, fac * sqrt(2.0 * dumm(IJK)));
587 }
588 }
589 }
590
591 dumm.fill(0.0);
592
600 const MFloat Oij = 0.5 * (uvwn(IJK, i, j) - uvwn(IJK, j, i));
601 const MFloat Ojk = 0.5 * (uvwn(IJK, j, k) - uvwn(IJK, k, j));
602 const MFloat Ski = 0.5 * (uvwn(IJK, k, i) + uvwn(IJK, i, k));
603 dumm(IJK) += Oij * Ojk * Ski;
604 }
605 }
606 }
607 }
608 }
609 }
610
612
620
624
626
627 const MFloat cellMetrics[9] = {
631
632 const MFloat ddxi = fjac * (omega(IPJK) - omega(IMJK));
633 const MFloat ddeta = fjac * (omega(IJPK) - omega(IJMK));
634 const MFloat ddzeta = fjac * (omega(IJKP) - omega(IJKM));
635
636 const MFloat domdx = cellMetrics[0] * ddxi + cellMetrics[3] * ddeta + cellMetrics[6] * ddzeta;
637 const MFloat domdy = cellMetrics[1] * ddxi + cellMetrics[4] * ddeta + cellMetrics[7] * ddzeta;
638 const MFloat domdz = cellMetrics[2] * ddxi + cellMetrics[5] * ddeta + cellMetrics[8] * ddzeta;
639
640
641 const MFloat dudx = uvwn(IJK, 0, 0);
642 const MFloat dudy = uvwn(IJK, 0, 1);
643 const MFloat dudz = uvwn(IJK, 0, 2);
644
645 const MFloat dvdx = uvwn(IJK, 1, 0);
646 const MFloat dvdy = uvwn(IJK, 1, 1);
647 const MFloat dvdz = uvwn(IJK, 1, 2);
648
649 const MFloat dwdx = uvwn(IJK, 2, 0);
650 const MFloat dwdy = uvwn(IJK, 2, 1);
651 const MFloat dwdz = uvwn(IJK, 2, 2);
652
653 const MFloat dndx = uvwn(IJK, 3, 0);
654 const MFloat dndy = uvwn(IJK, 3, 1);
655 const MFloat dndz = uvwn(IJK, 3, 2);
656
657 const MFloat CDNOM = dndx * domdx + dndy * domdy + dndz * domdz;
660
663
665 (dudy * (dudy + dvdx) + dudz * (dudz + dwdx) + dvdx * (dvdx + dudy) + dvdz * (dvdz + dwdy)
666 + dwdx * (dwdx + dudz) + dwdy * (dwdy + dvdz) + 2.0 * dudx * dudx + 2.0 * dvdy * dvdy + 2.0 * dwdz * dwdz);
667
670 MFloat prod = prod1 - (1.0 -
RM_FS::faalpha * fv2t) * F2B3 * nuTilde[IJK] * (dudx + dvdy + dwdz) * rho[IJK];
671 const MFloat dest = (betas - beta) * nuTilde[IJK] * omega(IJK) * rho[IJK] + rho[IJK] * crdif * 0.125;
673 0.0, 2.0 * rRe * rho[IJK] / omega(IJK) * (muLam[IJK] / rho[IJK] +
RM_FS::fasigma * nuTilde[IJK]) * CDNOM);
674
675 prod += prodwall;
676
678 }
679 }
680 }
681
682
694
695 const MFloat cornerMetrics[9] = {
699
700 const MFloat nutldAvg = F1B8
701 * (nuTilde[IPJPKP] + nuTilde[IJPKP] + nuTilde[IJPK] + nuTilde[IPJPK] + nuTilde[IPJKP]
702 + nuTilde[IJKP] + nuTilde[IJK] + nuTilde[IPJK]);
703
704 const MFloat nuLamAvg = F1B8
705 * (muLam[IPJPKP] / rho[IPJPKP] + muLam[IJPKP] / rho[IJPKP] + muLam[IJPK] / rho[IJPK]
706 + muLam[IPJPK] / rho[IPJPK] + muLam[IPJKP] / rho[IPJKP] + muLam[IJKP] / rho[IJKP]
707 + muLam[IJK] / rho[IJK] + muLam[IPJK] / rho[IPJK]);
708
709 const MFloat dnutldxi = F1B4
710 * (nuTilde[IPJPKP] + nuTilde[IPJPK] + nuTilde[IPJKP] + nuTilde[IPJK] - nuTilde[IJPKP]
711 - nuTilde[IJPK] - nuTilde[IJKP] - nuTilde[IJK]);
712 const MFloat dnutldet = F1B4
713 * (nuTilde[IPJPKP] + nuTilde[IJPKP] + nuTilde[IPJPK] + nuTilde[IJPK] - nuTilde[IPJKP]
714 - nuTilde[IJKP] - nuTilde[IPJK] - nuTilde[IJK]);
715 const MFloat dnutldze = F1B4
716 * (nuTilde[IPJPKP] + nuTilde[IJPKP] + nuTilde[IPJKP] + nuTilde[IJKP] - nuTilde[IPJPK]
717 - nuTilde[IJPK] - nuTilde[IPJK] - nuTilde[IJK]);
718
719 const MFloat dnutldx = (dnutldxi * cornerMetrics[
xsd * 3 +
xsd] + dnutldet * cornerMetrics[
ysd * 3 +
xsd]
720 + dnutldze * cornerMetrics[
zsd * 3 +
xsd]);
721
722 const MFloat dnutldy = (dnutldxi * cornerMetrics[
xsd * 3 +
ysd] + dnutldet * cornerMetrics[
ysd * 3 +
ysd]
723 + dnutldze * cornerMetrics[
zsd * 3 +
ysd]);
724
725 const MFloat dnutldz = (dnutldxi * cornerMetrics[
xsd * 3 +
zsd] + dnutldet * cornerMetrics[
ysd * 3 +
zsd]
726 + dnutldze * cornerMetrics[
zsd * 3 +
zsd]);
727
729
731 * (dnutldx * cornerMetrics[
xsd * 3 +
xsd] + dnutldy * cornerMetrics[
xsd * 3 +
ysd]
732 + dnutldz * cornerMetrics[
xsd * 3 +
zsd]));
733
735 * (dnutldx * cornerMetrics[
ysd * 3 +
xsd] + dnutldy * cornerMetrics[
ysd * 3 +
ysd]
736 + dnutldz * cornerMetrics[
ysd * 3 +
zsd]));
737
739 * (dnutldx * cornerMetrics[
zsd * 3 +
xsd] + dnutldy * cornerMetrics[
zsd * 3 +
ysd]
740 + dnutldz * cornerMetrics[
zsd * 3 +
zsd]));
741 }
742 }
743 }
744
752
753 eflux[3][IJK] = F1B4 * (eflux[6][IJK] + eflux[6][IJKM] + eflux[6][IJMK] + eflux[6][IJMKM]);
754 }
755 }
756 }
757
758
766
767 fflux[3][IJK] = F1B4 * (fflux[6][IJK] + fflux[6][IJKM] + fflux[6][IMJK] + fflux[6][IMJKM]);
768 }
769 }
770 }
771
779
780 gflux[3][IJK] = F1B4 * (gflux[6][IJK] + gflux[6][IMJK] + gflux[6][IJMK] + gflux[6][IMJMK]);
781 }
782 }
783 }
784
785
793 const MFloat dissipation_term =
794 ((eflux[3][IJK] - eflux[3][IMJK]) + (fflux[3][IJK] - fflux[3][IJMK]) + (gflux[3][IJK] - gflux[3][IJKM]));
795
797 }
798 }
799 }
800}
void viscousFluxLES()
Viscous flux computation.
void computeTurbViscosity_FS()
This class is a ScratchSpace.
static constexpr MFloat faalpha
static constexpr MFloat fapsik2
static constexpr MFloat fabetcs
static constexpr MFloat fapsik1
static constexpr MFloat fasigma
static constexpr MFloat fabetc