[Nek5000-users] fix projection for multiple passive scalars

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Oct 19 03:50:23 CDT 2017


Hi Neks,

in order to use projection (p94!=0) for one temperature field and at 
least one additional passive scalar, I believe that the variables 
napproxt and approxt need to be extended by the size of ldimt. See the 
attached git-diff.txt for my changes to the code.

When I adjust the code like that, projection for veloctity, temperature 
and all passive scalars works, otherwise it fails with:

...
22  Error Hmholtz TEMP     100          NaN          NaN 1.0000E-08
22proj_ortho:    1   2 TEMP   Detect rank deficiency: NaN         NaN
22  Project PS 1                  NaN          NaN          NaN 1   0
22  Error Hmholtz PS 1     100          NaN          NaN 1.0000E-08
22proj_ortho:    1   2 PS 1   Detect rank deficiency: NaN         NaN
22  Project PS 2                  NaN          NaN          NaN 1   0
22  Error Hmholtz PS 2     100          NaN          NaN 1.0000E-08
22proj_ortho:    1   2 PS 2   Detect rank deficiency: NaN         NaN
...

Can one of the developers please confirm and if confirmed include it in 
the master branch?


Best,
Steffen Straub


-- 
Karlsruhe Institute of Technology (KIT)
Institute of Fluid Mechanics

M.Sc. Steffen Straub
Doctoral Researcher

Kaiserstraße 10
Building 10.23
76131 Karlsruhe, Germany

Phone: +49 721 608-43027
E-mail: steffen.straub at kit.edu
Web: http://www.istm.kit.edu

Registered office:
Kaiserstraße 12, 76131 Karlsruhe, Germany

KIT – The Research University in the Helmholtz Association

-------------- next part --------------
diff --git a/core/ORTHOT b/core/ORTHOT
index dfd3efd..5a87743 100644
--- a/core/ORTHOT
+++ b/core/ORTHOT
@@ -5,10 +5,13 @@ c
 c     parameter (ktott = 1)
 c     parameter (laxtt = 1)
 c
-      integer         napproxt(2)
+C Each approximation space for passive scalars should have 
+C its own approximation space.
+C Hence, extend napproxt and approxt by ldimt.
+      integer         napproxt(2,ldimt)
       common /trthoi/ napproxt
 
-      real            approxt(ktott,0:laxtt)
+      real            approxt(ktott,0:laxtt,ldimt)
       common /trthov/ approxt
 
       character*4     name4t
diff --git a/core/conduct.f b/core/conduct.f
index 301dc3b..d0f7bd9 100644
--- a/core/conduct.f
+++ b/core/conduct.f
@@ -27,7 +27,11 @@ C
       endif
 
 
-      napproxt(1) = laxtt  ! Fix this... pff 10/10/15
+c      napproxt(1) = laxtt  ! Fix this... pff 10/10/15
+C napproxt has been extended to account for each passive scalar
+C individually
+      napproxt(1,ifield-1) = laxtt  ! for each ifield
+      
 
       nel    = nelfld(ifield)
       n   = nx1*ny1*nz1*nel
@@ -82,12 +86,17 @@ c    $                 ,tmult(1,1,1,1,ifield-1)
 c    $                 ,imesh,tolht(ifield),nmxh,isd)
 
          if(iftmsh(ifield)) then
+C When calling hsolve, we need to pass the correct approxt and napproxt
+C depending on which ifield (passive scalar) we are working on.
            call hsolve  (name4t,TA,TB,H1,H2 
      $                   ,tmask(1,1,1,1,ifield-1)
      $                   ,tmult(1,1,1,1,ifield-1)
      $                   ,imesh,tolht(ifield),nmxh,1
-     $                   ,approxt,napproxt,bintm1)
+     $                   ,approxt(1,1,ifield-1),napproxt(1,ifield-1)
+     &                   ,bintm1)
          else
+C For Cases where iftmsh(ifield)=False, I do not know whether something 
+C needs to be adjusted too.
            call hsolve  (name4t,TA,TB,H1,H2 
      $                   ,tmask(1,1,1,1,ifield-1)
      $                   ,tmult(1,1,1,1,ifield-1)
diff --git a/core/perturb.f b/core/perturb.f
index 59c16ea..359b326 100644
--- a/core/perturb.f
+++ b/core/perturb.f
@@ -599,7 +599,8 @@ C
      $              ,H2(LX1,LY1,LZ1,LELT)
 c
       include 'ORTHOT'
-      napproxt(1) = laxtt
+C      napproxt(1) = laxtt
+      napproxt(1,ifield-1) = laxtt
 C
       IF (IGEOM.EQ.1) THEN
 C


More information about the Nek5000-users mailing list