where to define compre

Submitted by gelinhan on Fri, 05/11/2018 - 08:43

Hi all,

I often found the #ifdef compre in CFDEM code. My question is where the "compre" should be defined. Since I am developing a new solver which includes the density in the momentum equation, I might need to activate the conditional compilation under ifdef compre.

Thank you,
Linhan

paul | Fri, 05/11/2018 - 12:10

go to $CFDEM_SRC_DIR/lagrangian/cfdemParticleComp and run wmake there. This will compile the compressible variant of the cfdem library.

- Paul

Jak | Mon, 09/03/2018 - 19:25

Hey,

I wonder how the switch to compressible actually works.

Basically I am currently trying to build a compressible Glowinski case right now. As mentioned above there is some sort of switch („#ifdef compre“ in the „forceSubModel.C“) to get from the default incompressible to the compressibe case (basically rho and p are adapted here).

As mentioned above the cfdemParticleComp folder needs to get compiled. How does this work in detail? The make/options file says:

/*NOTE: for compiling the lnInclude of cfdemParticle is needed (exist after wmake libso of cfdemParticle)*/
/*BUT: the *.dep files of cfdemParticle MUST NOT EXIST (do an rmdepall of of cfdemParticle)*/

So you need to keep the include files, but you have to remove the .dep files in cfdemParticle? Unfortunately rmdepall doesn‘t work at my computer („command not found“), so i deleted the files with

find . -type f -name '*.dep' -delete
find . -type f -name '*.dep' -delete

Is this equivalent? Or how can I get rmdepall?

Do I need to change in the options of the solver

-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \

to
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticleComp/lnInclude \
?

Or do I need to put the make folder of cfdemParticleComp into cfdemParticle? During the compilation of cfdemParticleComp a lnInclude folder gets build, but it remains empty...

What else needs to be changed? Rho needs to get added into the momentum equation in the cfdemSolverIB? And the demensions of pressure in the 0 folder need to get changed? Right?

Is there somewhere a step to step tutorial or guide to get from incompressible to compressible?
Are there any tricks?

Best,
Jakob

paul | Tue, 09/04/2018 - 13:41

>As mentioned above the cfdemParticleComp folder needs to get compiled. How does this work in detail?

In Make/options, the preprocessor flag compre is set, which tells the compiler to use the compressible code path.

> /*NOTE: for compiling the lnInclude of cfdemParticle is needed (exist after wmake libso of cfdemParticle)*/
> /*BUT: the *.dep files of cfdemParticle MUST NOT EXIST (do an rmdepall of of cfdemParticle)*/

Ancient comment. AFAIR it works even without cleaning.

> Unfortunately rmdepall doesn‘t work at my computer („command not found“)

Use wclean

> What else needs to be changed?

Study the differences between pimpleFoam and rhoPimpleFoam.

> Do I need to change in the options of the solver [...]

Correct.

> And the demensions of pressure in the 0 folder need to get changed? Right?

Correct.

mardussa | Tue, 09/11/2018 - 06:32

To add to Paul's comment, I found that wclean would remove the entire lnInclude directory, which is still required when using wmake in cfdemParticleComp, so I also manually removed the .dep files and was able to run wmake within cfdemParticleComp directory successfully.

After this I noticed that there is also a function called in the functions.sh file named wrmdep (OF version 3 onwards) or wrmdepall (OF versions prior to 3). I did not use either of these, however it would appear then that the steps suggested in cfdemParticleComp/Make/options are just slightly incorrect.

HhXia | Tue, 12/21/2021 - 14:36

Hello,

I also tried to compile the "cfdemParticleComp" with the methods discussed here at this post, however, I got nothing in the "lnInclude" folder after runing wmake within the "cfdemParticleComp" folder. BTW, I deleted the "*.dep" in the "cfdemParticle" folder before compiling the "cfdemParticleComp".

Do you know the reason behind this and how to fix?

Regards,
Huihuang