TonkomoLLC / MPPICInterDyMFoam

MPPICInterFoam extended to include AMI
GNU General Public License v3.0
7 stars 1 forks source link

Compiler error #3

Closed safal3 closed 2 years ago

safal3 commented 2 years ago

Hello TonkomoLLC,

I tried to compile your MMPICInterDyMFoam-Solver for particle tracking with two incompressible fluids, but I got a compiling error which I couldn’t solve so far. I will try to explain my problems and maybe you can help me.

First, I used OpenFoam-v2106, which stands in your description. Then I checked the options-file and there were a lot of paths, that partially didn’t exist anymore or were renamed. So I tried to find the right paths and replaced everything. I’m not sure if everything is correct, so that could definitely be one error source. Here is my first question: Why do the paths in the options-file don’t fit to OpenFoam-v2106? For example, since OpenFoam 8 there is the MomentumTransportModels-class and this isn’t existing in your options-file, but it has to be (I guess).

After I tried to fix the options-file I wanted to compile the embedded compressibleTwoPhaseMixtureTurbulenceModels-solver but got the following error message:

_wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file compressibleTwoPhaseMixtureTurbulenceModels.C g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABELSIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam9/src/finiteVolume/lnInclude -I/opt/openfoam9/src/meshTools/lnInclude -I/opt/openfoam9/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam9/src/transportModels -I/opt/openfoam9/src/twoPhaseModels -I/opt/openfoam9/src/MomentumTransportModels -I/opt/openfoam9/src/transportModels/dynamicTransportModel -I/opt/openfoam9/src/transportModels/kinematicTransportModel -I/opt/openfoam9/src/transportModels/viscosityModels/viscosityModel -I/opt/openfoam9/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam9/src/twoPhaseModels/interfaceProperties/lnInclude -I/opt/openfoam9/src/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam9/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/incompressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/phaseIncompressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude -IlnInclude -I. -I/opt/openfoam9/src/OpenFOAM/lnInclude -I/opt/openfoam9/src/OSspecific/POSIX/lnInclude -fPIC -c compressibleTwoPhaseMixtureTurbulenceModels.C -o Make/linux64GccDPInt32Opt/compressibleTwoPhaseMixtureTurbulenceModels.o compressibleTwoPhaseMixtureTurbulenceModels.C:45:1: error: expected constructor, destructor, or type conversion before ‘(’ token ( ^ In file included from /opt/openfoam9/src/OpenFOAM/lnInclude/typeInfo.H:57:0, from /opt/openfoam9/src/OpenFOAM/lnInclude/token.H:49, from /opt/openfoam9/src/OpenFOAM/lnInclude/UILListIO.C:28, from /opt/openfoam9/src/OpenFOAM/lnInclude/UILList.C:105, from /opt/openfoam9/src/OpenFOAM/lnInclude/UILList.H:390, from /opt/openfoam9/src/OpenFOAM/lnInclude/ILList.H:39, from /opt/openfoam9/src/OpenFOAM/lnInclude/IDLList.H:35, from /opt/openfoam9/src/OpenFOAM/lnInclude/entry.H:45, from /opt/openfoam9/src/OpenFOAM/lnInclude/dictionary.H:53, from /opt/openfoam9/src/OpenFOAM/lnInclude/IOdictionary.H:42, from /opt/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude/momentumTransportModel.H:38, from /opt/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude/MomentumTransportModel.H:38, from /opt/openfoam9/src/MomentumTransportModels/phaseCompressible/lnInclude/PhaseCompressibleMomentumTransportModel.H:39, from compressibleTwoPhaseMixtureTurbulenceModels.C:29: /opt/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude/makeMomentumTransportModel.H:61:45: error: ‘laminarimmiscibleIncompressibleTwoPhaseMixturePhaseCompressibleMomentumTransportModel’ has not been declared defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \ /opt/openfoam9/src/OpenFOAM/lnInclude/className.H:91:24:

… and so on and so on. I think the highlighted part is the main error and the following errors will be disappearing when the first one is fixed. Do you have any idea why the compiler crashes at this point? And why does the compiler need a constructor/destructor at this point? I’ve also tried to add a default constructer but this also doesn’t work. Maybe you can help me?

I’m thankful for any kind of help. Best regards, Sarah

TonkomoLLC commented 2 years ago

Hello, Sarah -

I reconfirmed that the solver works with OpenFOAM v2106, and the Make/options file is very similar to that in the original solver that this is forked from, MPPICInterFoam that comes with OpenFOAM v2106.

However, I believe you are telling me that this solver does not compile with OpenFOAM 8 or 9. This is expected, since the architecture of the ESI and CFD Direct forks of OpenFOAM has diverged over the past few years. I'm sure it's possible to convert MPPICInterDyMFoam to OpenFOAM 8 or 9, but it will take some effort to sort out what needs to change.

You may wish to start by comparing interDyMFoam/interFoam and MPPICFoam between v2106 and OpenFOAM 8 or 9. Such a comparison may give you an idea of what must be done to convert MPPICInterDyMFoam to OpenFOAM 8 or 9, since MPPICInterDyMFoam is a combination of InterDyMFoam in v2106/interFoam in v8/9 (dynamic mesh functions have been moved into the interFoam solver in v8/9) and MPPICFoam.

Best regards,

Eric

safal3 commented 2 years ago

Hello Eric,

thanks for your quick and helpful reply.

I also tried to compile the solver with OpenFoam 7 and got the same error message. I guess there could be a mistake in the inheritance hierarchy. If I am using the wrong version which has other structures, that could definitely be the reason for the compiler error.

However, do I understanding right that OpenFoam-v2106 and OpenFoam 8 or 9 aren’t the same? I didn’t know that so far. Is there a version which is comparable to v2106?

I’m sorry for my (maybe) stupid questions, but I’m relatively new in OpenFoam and it is still a little bit difficult for me to understand the relations in OpenFoam and how to implement an own solver.

Best regards, Sarah

TonkomoLLC commented 2 years ago

Yes, OpenFOAM 7, 8 and 9 are released by a different organization than that which releases OpenFOAM v2106, v2112, and so on. You can download OpenFOAM v2106 here. I also compiled the MPPICInterDyMFoam solver from this repo with OpenFOAM v2112, found here.

For a lot of applications, it doesn't really matter which fork of OpenFOAM you use (e.g., the CFD Direct fork, the latest of which is OpenFOAM 9, or the OpenCFD fork, the latest of which is OpenFOAM v2112). For the basic set of solvers and models common to both forks, you should get basically the same answer no matter which fork of OpenFOAM you use.

However, there are some instances where it is convenient to use one fork over another, particularly when there is a specific feature you need that is implemented in one fork but not the other.

In the case of MPPICInterDyMFoam, it was convenient to use the OpenCFD fork because the base solver which was modified to add dynamic meshing was found only in the OpenCFD fork (MPPICInterFoam). That is, MPPICInterFoam is not a solver found in the CFD Direct Fork (e.g., OpenFOAM 7, 8, and 9).

If you follow the compilation instructions for OpenFOAM v2106 or v2112 I hope you will find that MPPICInterDyMFoam complies without errors.

There are many tutorials on the internet for how to implement your own solver. I wish you success with this endeavor.

Best regards,

Eric