rans-uncertainty icon indicating copy to clipboard operation
rans-uncertainty copied to clipboard

Do I need to add make folder compilation to the Linearviscousstress folder

Open 3014214149 opened this issue 4 years ago • 4 comments

Dear Geneva, I have succeeded in compiling reynoldsNet library. Now, according to your tutorial, if I want to compile simpleNN solver, I should first compile linearViscousStress. But I noticed that there lacked a "Make" folder in "linearViscousStress". Do I need to add "make" folder to it?

3014214149 avatar Jan 11 '21 11:01 3014214149

Glad to hear you're making progress.

Yes, you do need to compile the linear viscous stress model because of an added method that computes the Reynolds stress with the NN. This method takes in the velocity, rotation and strain tensors and then executes the forward pass of the neural network with the compiled reynoldsNet.

However, I don't think you shouldn't need any special caffe2 libaries or anything for this to compile so you can use OpenFOAMs default make folder since reynolds net is already compiled. From there you will then compile the incompressible turbulence model library if I remember correctly and then you should be set to compile the simpleNNFoam model.

NickGeneva avatar Jan 11 '21 13:01 NickGeneva

Glad to hear you're making progress.

Yes, you do need to compile the linear viscous stress model because of an added method that computes the Reynolds stress with the NN. This method takes in the velocity, rotation and strain tensors and then executes the forward pass of the neural network with the compiled reynoldsNet.

However, I don't think you shouldn't need any special caffe2 libaries or anything for this to compile so you can use OpenFOAMs default make folder since reynolds net is already compiled. From there you will then compile the incompressible turbulence model library if I remember correctly and then you should be set to compile the simpleNNFoam model.

Geneva, I have compiled the LinearViscousStress lib. But when I compiled incompressible lib, I met problems again. In my openfoam platforms, there eixitec libreynoldsnet.so, but when I compile incompressible lib, it told me that /usr/bin/ld: connot find -lreynoldsnet. Could you tell me why?

3014214149 avatar Jan 17 '21 11:01 3014214149

I would check to see of the library has been created in the $(FOAM_LIBBIN)/libreynoldsnet directory with the other OpenFOAM libraries. The environment variable FOAM_LIBBIN should be the default location openFOAM links libraries from. If the compiler still cannot find it, then maybe try explicitly including the library with -L or including the directory with -I flags.

Some additional information on linking libraries in OpenFOAM can be found here in section 3.2.2.2: https://cfd.direct/openfoam/user-guide/v6-compiling-applications/.

NickGeneva avatar Jan 18 '21 13:01 NickGeneva

I would check to see of the library has been created in the $(FOAM_LIBBIN)/libreynoldsnet directory with the other OpenFOAM libraries. The environment variable FOAM_LIBBIN should be the default location openFOAM links libraries from. If the compiler still cannot find it, then maybe try explicitly including the library with -L or including the directory with -I flags.

Some additional information on linking libraries in OpenFOAM can be found here in section 3.2.2.2: https://cfd.direct/openfoam/user-guide/v6-compiling-applications/.

Geneva,

Thanks for your reply. Actually, I changed "files" in reynoldsNet "Make" folder. I changed FOAM_LIBBIN to FOAM_USER_LIBBIN. And libreynoldsnet.so has been created in user folder. It seemed that only by including the library with -L wxplicitly, could the compilation be succeeded. Now I have solved this problem.

But there's a warning "no return statement in function returning non-void [-Wreturn-type]" when compiling incompressible.lib. This resulted in fail in simpleNN compiltion. This error occured in imcompressible.H. line 140. The code is “ virtual tmp<fvVectorMatrix> divDevReff ( volVectorField& U, volTensorField& S, volTensorField& R ) { } //line 140 ” Then should I modifed the code?

3014214149 avatar Jan 19 '21 06:01 3014214149