Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Antuono vortex initial field. #123

Merged
merged 3 commits into from
Jul 18, 2024
Merged

3D Antuono vortex initial field. #123

merged 3 commits into from
Jul 18, 2024

Conversation

gianlupo
Copy link
Contributor

No description provided.

@p-costa p-costa self-requested a review July 18, 2024 08:49
@p-costa
Copy link
Collaborator

p-costa commented Jul 18, 2024

Thanks Giando! @gianlupo

I did some minor nitpicking. You could incorporate it in your PR by copying the diff below into a patch.diff file and then do git apply patch.diff and push the changes here (perhaps there is a smarter way of doing this...). See below:

diff --git a/src/initflow.f90 b/src/initflow.f90
index 31fdf9f..5e3cc24 100644
--- a/src/initflow.f90
+++ b/src/initflow.f90
@@ -116,8 +116,7 @@ module mod_initflow
       end do
     case('ant')
       !
-      ! see M. Antuono, JFM 890-A23 (2020)
-      ! N.B. requires the domain to be a (2*pi)^3 triperiodic box
+      ! see M. Antuono, JFM 890, A23 (2020)
       !
       do k=1,n(3)
         zcc = zc(k)/l(3)*2.*pi+0.5*pi
@@ -128,13 +127,13 @@ module mod_initflow
           do i=1,n(1)
             xc = (i+lo(1)-1-.5)*dl(1)/l(1)*2.*pi+0.5*pi
             xf = (i+lo(1)-1-.0)*dl(1)/l(1)*2.*pi+0.5*pi
-            u(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xf-5.*pi/6.)*cos(yc-1.*pi/6.)*sin(zcc         ) &
-                                                 -sin(xf-1.*pi/6.)*sin(yc         )*cos(zcc-5.*pi/6.))*uref
-            v(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xc         )*sin(yf-5.*pi/6.)*sin(zcc-1.*pi/6.) &
-                                                 -cos(xc-5.*pi/6.)*sin(yf-1.*pi/6.)*sin(zcc         ))*uref
-            w(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(cos(xc-1.*pi/6.)*sin(yc         )*sin(zff-5.*pi/6.) &
-                                                 -sin(xc         )*cos(yc-5.*pi/6.)*sin(zff-1.*pi/6.))*uref
-            p(i,j,k) = -(1./2.)*(u(i,j,k)**2+v(i,j,k)**2+w(i,j,k)**2)
+            u(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xf-5.*pi/6.)*cos(yc-1.*pi/6.)*sin(zcc         ) - &
+                                                  sin(xf-1.*pi/6.)*sin(yc         )*cos(zcc-5.*pi/6.))*uref
+            v(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xc         )*sin(yf-5.*pi/6.)*sin(zcc-1.*pi/6.) - &
+                                                  cos(xc-5.*pi/6.)*sin(yf-1.*pi/6.)*sin(zcc         ))*uref
+            w(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(cos(xc-1.*pi/6.)*sin(yc         )*sin(zff-5.*pi/6.) - &
+                                                  sin(xc         )*cos(yc-5.*pi/6.)*sin(zff-1.*pi/6.))*uref
+            p(i,j,k) = -(u(i,j,k)**2+v(i,j,k)**2+w(i,j,k)**2)/2.
           end do
         end do
       end do

Thanks again!

@p-costa p-costa removed their request for review July 18, 2024 08:49
@p-costa p-costa changed the title 3D Antuono vortex initial field 3D Antuono vortex initial field. Jul 18, 2024
@gianlupo
Copy link
Contributor Author

Thanks Giando! @gianlupo

I did some minor nitpicking. You could incorporate it in your PR by copying the diff below into a patch.diff file and then do git apply patch.diff and push the changes here (perhaps there is a smarter way of doing this...). See below:

diff --git a/src/initflow.f90 b/src/initflow.f90
index 31fdf9f..5e3cc24 100644
--- a/src/initflow.f90
+++ b/src/initflow.f90
@@ -116,8 +116,7 @@ module mod_initflow
       end do
     case('ant')
       !
-      ! see M. Antuono, JFM 890-A23 (2020)
-      ! N.B. requires the domain to be a (2*pi)^3 triperiodic box
+      ! see M. Antuono, JFM 890, A23 (2020)
       !
       do k=1,n(3)
         zcc = zc(k)/l(3)*2.*pi+0.5*pi
@@ -128,13 +127,13 @@ module mod_initflow
           do i=1,n(1)
             xc = (i+lo(1)-1-.5)*dl(1)/l(1)*2.*pi+0.5*pi
             xf = (i+lo(1)-1-.0)*dl(1)/l(1)*2.*pi+0.5*pi
-            u(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xf-5.*pi/6.)*cos(yc-1.*pi/6.)*sin(zcc         ) &
-                                                 -sin(xf-1.*pi/6.)*sin(yc         )*cos(zcc-5.*pi/6.))*uref
-            v(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xc         )*sin(yf-5.*pi/6.)*sin(zcc-1.*pi/6.) &
-                                                 -cos(xc-5.*pi/6.)*sin(yf-1.*pi/6.)*sin(zcc         ))*uref
-            w(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(cos(xc-1.*pi/6.)*sin(yc         )*sin(zff-5.*pi/6.) &
-                                                 -sin(xc         )*cos(yc-5.*pi/6.)*sin(zff-1.*pi/6.))*uref
-            p(i,j,k) = -(1./2.)*(u(i,j,k)**2+v(i,j,k)**2+w(i,j,k)**2)
+            u(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xf-5.*pi/6.)*cos(yc-1.*pi/6.)*sin(zcc         ) - &
+                                                  sin(xf-1.*pi/6.)*sin(yc         )*cos(zcc-5.*pi/6.))*uref
+            v(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(sin(xc         )*sin(yf-5.*pi/6.)*sin(zcc-1.*pi/6.) - &
+                                                  cos(xc-5.*pi/6.)*sin(yf-1.*pi/6.)*sin(zcc         ))*uref
+            w(i,j,k) = (4.*sqrt(2.)/3./sqrt(3.))*(cos(xc-1.*pi/6.)*sin(yc         )*sin(zff-5.*pi/6.) - &
+                                                  sin(xc         )*cos(yc-5.*pi/6.)*sin(zff-1.*pi/6.))*uref
+            p(i,j,k) = -(u(i,j,k)**2+v(i,j,k)**2+w(i,j,k)**2)/2.
           end do
         end do
       end do

Thanks again!

Nice, done, thanks!

@p-costa p-costa merged commit 4b17b50 into CaNS-World:main Jul 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants