CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Is it possible to call a library from a different version of OF? (https://www.cfd-online.com/Forums/openfoam-programming-development/199714-possible-call-library-different-version.html)

ripperjack March 13, 2018 09:47

Is it possible to call a library from a different version of OF?
 
Dear All,

This may sound weird to you, but the situation is that we have invested a lot to develop a solver based on an old version of OF. Now we want to use some new features from latest OF, e.g., the new wall distance calculation.

Upgrading our solver to the latest OF version will be very time consuming and we are super lazy. :D

So here is what we want to do: In our solver (OF24), call this new wallDist function (OF50) and return the wall distance field. Is it possible?

Ideally, if I can compile a completely standalone library from OF50 and call it from OF24, that will work. But as I know, it is hard to do that. Any ideas?

Thanks very much in advance!

Regards,
Jack

Blumenkind March 14, 2018 04:39

Have you tried copying the library (with adjusted Make/files and /options) and recompiling it? Without looking at it, maybe some adjustements have to be made, but i would guess you could follow the errors, wmake will give you :)

ripperjack March 14, 2018 09:10

Quote:

Originally Posted by Blumenkind (Post 685129)
Have you tried copying the library (with adjusted Make/files and /options) and recompiling it? Without looking at it, maybe some adjustements have to be made, but i would guess you could follow the errors, wmake will give you :)

Thanks for the suggestion. But I am not quite sure how to do it. Are you suggesting me compile a OpenFOAM5.0 library using OpenFOAM240? That will probably not solve our problem. I DO need this library compiled by OpenFOAM5.0 since I may use multiple new features. Changing all of them to OpenFOAM240 "format" may need quite a lot time and I am not sure if they will all work out.

Jack.

ripperjack March 16, 2018 14:32

Any ideas? Thanks!

Blumenkind March 20, 2018 06:50

Well, I would suggest you try it. I really cannot tell you how many differences there are or how much work it will be. But I cannot think of any method, which will be any less work.

akidess March 21, 2018 04:35

Unless you are doing strange things, updating your solver will be less time consuming and is a worthy investment compared to back-porting the library.

ripperjack March 21, 2018 12:41

Quote:

Originally Posted by akidess (Post 685987)
Unless you are doing strange things, updating your solver will be less time consuming and is a worthy investment compared to back-porting the library.

Hi Anton,

Thanks for your reply. But yes, we are doing the strange thing...

The scenario is that our solver needs to call functions from more than two versions of OpenFOAM, developed by different groups of people.

Say, our solver is based on OF240, we need to call functions from OF-V1 (developed by group A), OF-V2 (developed by group B), OF-V3 (developed by group C). All these groups implemented a lot of their own stuff, so it is impossible to just upgrade to one version while having all the functions we need.

Anyway, that is why we need a trick to call functions from different versions of OpenFOAM.

Thanks,
Jack

ripperjack April 3, 2018 22:07

Any ideas? Thanks. Jack.


All times are GMT -4. The time now is 05:45.