From 66a93d8a65cf280bfa02b5db7b31c4ad74ab66c7 Mon Sep 17 00:00:00 2001
From: PP <pouech@kraken1.cluster>
Date: Tue, 21 Sep 2021 18:47:27 +0200
Subject: [PATCH]  Updated Covo for unaligned convection

---
 apps/showcases/COVO/COVO.cpp | 15 +++++++++------
 apps/showcases/COVO/COVO.prm |  5 +++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/apps/showcases/COVO/COVO.cpp b/apps/showcases/COVO/COVO.cpp
index 4dfd73b10..7f6132336 100644
--- a/apps/showcases/COVO/COVO.cpp
+++ b/apps/showcases/COVO/COVO.cpp
@@ -49,8 +49,8 @@ class CovoInit
 {
  public:
 
-   CovoInit( real_t circulation, real_t radius, Vector3<real_t> center, real_t lattice_velocity, real_t ss_lattice ) :
-      circulation_( circulation ), radius_(radius), center_(center), lattice_velocity_(lattice_velocity), ss_lattice_(ss_lattice){}
+   CovoInit( real_t circulation, real_t radius, Vector3<real_t> center,  real_t lattice_velocity, real_t lattice_velocity_Y, real_t ss_lattice ) :
+      circulation_( circulation ), radius_(radius), center_(center), lattice_velocity_(lattice_velocity), lattice_velocity_Y_(lattice_velocity_Y), ss_lattice_(ss_lattice){}
 
    void operator()(const shared_ptr< StructuredBlockForest >& SbF, BlockDataID densityFieldID, BlockDataID velFieldID ) const;
 
@@ -60,6 +60,7 @@ class CovoInit
    const real_t radius_;
    const Vector3<real_t> center_;
    const real_t lattice_velocity_;
+   const real_t lattice_velocity_Y_;
    const real_t ss_lattice_;
 }; // class ShearProfile
 
@@ -85,7 +86,7 @@ void CovoInit::operator()(const shared_ptr< StructuredBlockForest >& SbF, BlockD
          real_t rho_loc = exp( -(circ2 / 2 * ss_lattice_) * var * beta);
 
          velField->get(x, y, z, 0) = d_psi_x + lattice_velocity_;
-         velField->get(x, y, z, 1) = -d_psi_y;
+         velField->get(x, y, z, 1) = -d_psi_y + lattice_velocity_Y_;
 
          densityField->get(x, y, z) = 1.0 * rho_loc;  // lattice density is 1.0
       )
@@ -107,7 +108,8 @@ int main(int argc, char** argv)
    auto parameters = walberlaEnv.config()->getOneBlock("Parameters");
 
    const real_t ReferenceLength = parameters.getParameter< real_t >("ReferenceLength", real_t(0.1));
-   const real_t ConvectionVelocity = parameters.getParameter< real_t >("ConvectionVelocity", real_t(170.0));
+   const real_t ConvectionVelocity_X = parameters.getParameter< real_t >("ConvectionVelocity_X", real_t(170.0));
+   const real_t ConvectionVelocity_Y = parameters.getParameter< real_t >("ConvectionVelocity_Y", real_t(0.0));
    const real_t Radius = parameters.getParameter< real_t >("Radius", real_t(0.005));
    // const real_t Density = parameters.getParameter< real_t >("Density", real_t(1.16));
    const real_t Circulation = parameters.getParameter< real_t >("Circulation", real_t(34.728));
@@ -122,11 +124,12 @@ int main(int argc, char** argv)
 
    // real_t  Cd = Density / LatticeDensity;
    real_t Cl = ReferenceLength / LatticeLength;
-   real_t Cu = ConvectionVelocity / LatticeVelocity;
+   real_t Cu = ConvectionVelocity_X / LatticeVelocity;
    real_t Ct = Cl / Cu;
 
    real_t LatticeCirculation = Circulation / Cl * Ct;
    real_t LatticeRadius = Radius / Cl;
+   real_t LatticeVelocity_Y = ConvectionVelocity_Y   / Cu;
 
    real_t SSLattice = S_speed / Cu;
 
@@ -148,7 +151,7 @@ int main(int argc, char** argv)
    BlockDataID densityFieldID = field::addToStorage< ScalarField_T >(blocks, "density", real_t(1), field::fzyx);
 
 
-   CovoInit InitData(LatticeCirculation, LatticeRadius, center, LatticeVelocity, SSLattice);
+   CovoInit InitData(LatticeCirculation, LatticeRadius, center, LatticeVelocity, LatticeVelocity_Y, SSLattice);
    InitData(blocks, densityFieldID, velFieldID);
 
    pystencils::COVO_MacroSetter setterSweep(densityFieldID, pdfFieldID, velFieldID);
diff --git a/apps/showcases/COVO/COVO.prm b/apps/showcases/COVO/COVO.prm
index 9f9648deb..fc7eebefd 100644
--- a/apps/showcases/COVO/COVO.prm
+++ b/apps/showcases/COVO/COVO.prm
@@ -3,7 +3,8 @@ Parameters
 {
 
     ReferenceLength  0.1;       // m
-    ConvectionVelocity 170.0;   // m / s
+    ConvectionVelocity_X 170.0;   // m / s
+    ConvectionVelocity_Y 0.0;   // m / s
     Radius 0.005;               // m
     Density 1.16;               // Kg / m^3
     Circulation 34.728;         // m^2 / s
@@ -25,4 +26,4 @@ DomainSetup
    blocks        <  1,    1, 1 >;
    cellsPerBlock <  400, 400, 1 >;
    periodic      <  1,    1, 0 >;
-}
\ No newline at end of file
+}
-- 
GitLab