Compiling hisa on openfoam10

Hello, I was in the process of putting together a docker image for openfoam10 and I have this problem compiling hisa:

wmake hisa
g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -g -DFOUNDATION=10 -I../solver/lnInclude -I../../finiteVolume/jacobians/jacobianMatrix -I../../solvers/lnInclude -I../../preconditioners/lnInclude -I../../finiteVolume/lnInclude -I/opt/openfoam10/src/finiteVolume/lnInclude -I/opt/openfoam10/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam10/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam10/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam10/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam10/src/MomentumTransportModels/incompressible/lnInclude -I/opt/openfoam10/src/physicalProperties/lnInclude -I/opt/openfoam10/src/ThermophysicalTransportModels/lnInclude -I/opt/openfoam10/src/fvMeshTopoChangers/lnInclude -I/opt/openfoam10/src/dynamicMesh/lnInclude -I/opt/openfoam10/src/meshTools/lnInclude  -IlnInclude -I. -I/opt/openfoam10/src/OpenFOAM/lnInclude -I/opt/openfoam10/src/OSspecific/POSIX/lnInclude   -fPIC -c hisaModule.C -o Make/linux64GccDPInt32Opt/hisaModule.o
In file included from hisaModule.C:153:
createDynamicFvMesh.H: In member function 'virtual void Foam::hisaModule::initialise()':
createDynamicFvMesh.H:70:9: error: 'dynamicFvMesh' has not been declared
   70 |         dynamicFvMesh::New
      |         ^~~~~~~~~~~~~

I have downloaded the latest hisa from here: https://sourceforge.net/projects/hisa/files/hisa-master.zip/download

I noticed that there are two versions of createDynamicFvMesh.H

--- ./src/modules/hisa/createDynamicFvMesh.H	2021-02-11 07:15:13.000000000 +0000
+++ ./src/modules/solver/createDynamicFvMesh.H	2023-09-21 06:09:38.000000000 +0000
@@ -48,7 +48,7 @@
 if (!dynamicMeshDict.headerOk())
 {
     Info << "Creating static mesh" << nl << endl;
-    mesh_.set
+    mesh_.reset
     (
         new fvMesh
         (
@@ -65,9 +65,13 @@
 else
 {
     Info << "Creating dynamic mesh" << nl << endl;
-    mesh_.set
+    mesh_.reset
     (
+        #if FOUNDATION >= 10
+        new fvMesh
+        #else
         dynamicFvMesh::New
+        #endif
         (
             IOobject
             (
@@ -76,7 +80,11 @@
                 runTime,
                 IOobject::MUST_READ
             )
+        #if FOUNDATION >= 10
+        )
+        #else
         ).ptr()
+        #endif
     );
 }

Does the newer version replace the older version, or do I have some other issue with the setup?

Thanks a lot

Just an update - I believe that I got caught by a discrepancy between the readmes on github/gitlab.

Github has:

  • OpenFOAM Foundation versions 9-10 or ESI-OpenCFD versions 2006-2306

Gitlab has

  • OpenFOAM Foundation versions 5-9 or ESI-OpenCFD versions 1706-2112

It looks like Gitlab is correct. I have been able to compile by using hisa from gitlab (on both the foundation and the ESI version), however hisa has a floating point exception when running this dart example on both foundation version 10 and ESI version 2306.

Unfortunately I don’t know enough about hisa or openfoam to help resolve the issue.

Also I assume the above dart example is ok and not itself causing the problem on the later versions.

If anyone wants to try other hisa simulations, please feel free to try the following docker images (follow the docker install instructions in the readme)

Sorry about this. It was an issue in my packaging script that was keeping old files around. This should be resolved now. Compiles fine for me with OF 10.

We actually moved back to using the Github version a while ago and I put the Gitlab one into ‘archived’ mode at that point, so it is quite out of date. To avoid further confusion I have deleted it now.

Thanks - it seems the applications directory has been lost in the most recent update of hisa-master on sourceforge though? I assume this is needed (Allmake throws an error).

Just on the dart example floating point exception error, I have done some further testing using the hisa downloaded from gitlab.

At least 3 of the examples included with gitlab hisa 1.9.6 (basicFinner, nacaAirfoil, forwardStep) run fine on my compiled ESI and foundation foams.

However @thschrader 's dart example only runs using the openfoam9/hisa 1.7.3 combo (ESI/hisa1.7.3 not tested). The foundation & esi with hisa 1.9.6 combinations raise a floating point exception - see attached log. I haven’t looked into it enough to see if it is a meshing mpi n-processes issue, or if something else is going on (and I don’t really have the understanding to help diagnose the cause)

Thanks for the work you have put into this.

No idea what happened there, but I think it’s fixed now.

Just on the dart example floating point exception error, I have done some further testing using the hisa downloaded from gitlab.

At least 3 of the examples included with gitlab hisa 1.9.6 (basicFinner, nacaAirfoil, forwardStep) run fine on my compiled ESI and foundation foams.

However @thschrader 's dart example only runs using the openfoam9/hisa 1.7.3 combo (ESI/hisa1.7.3 not tested). The foundation & esi with hisa 1.9.6 combinations raise a floating point exception - see attached log. I haven’t looked into it enough to see if it is a meshing mpi n-processes issue, or if something else is going on (and I don’t really have the understanding to help diagnose the cause)

Thanks for the work you have put into this.

Thanks for the info. I’ll see if I can make any sense of it.

Seems to be fine if I change the initial velocity value to use the free-stream value from the open boundary rather than zero. This is a more robust choice to avoid a huge initial discontinuity at the outer boundary which I would guess is the source of the issue.

I initialize the v-field with (0,0,0), because when using the free-stream v instead
you get a huge force-bump when the solver starts. I wonder how to avoid both discontinuities
at the same time.
force_plot_antenna.png