CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] OpenFOAM 8 compatible with Swak4FOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 2 Post By olesen
  • 2 Post By gschaider
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2020, 20:11
Default OpenFOAM 8 compatible with Swak4FOAM
  #1
New Member
 
Anonymous
Join Date: Oct 2020
Posts: 1
Rep Power: 0
DaniEng is on a distinguished road
Hi,

I'm interested in working with time-varying boundary conditions and have OpenFOAM 8 installed. I wish to install swak4FOAM to use their groovybc function.

Is OpenFOAM 8 compatible with swak4FOAM? The documentation of swak4FOAM only mentions up to openFOAM 3.0 but since it seems like with such a handy set of libraries, there should be one compatible with the later versions of OpenFOAM.

thanks!
DaniEng is offline   Reply With Quote

Old   October 12, 2020, 07:40
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,230
Rep Power: 30
olesen will become famous soon enougholesen will become famous soon enough
Quote:
Originally Posted by DaniEng View Post
Hi,

I'm interested in working with time-varying boundary conditions and have OpenFOAM 8 installed. I wish to install swak4FOAM to use their groovybc function.

Is OpenFOAM 8 compatible with swak4FOAM? The documentation of swak4FOAM only mentions up to openFOAM 3.0 but since it seems like with such a handy set of libraries, there should be one compatible with the later versions of OpenFOAM.
I haven't tried that particular combination, but Bernhard puts an enormous effort into maintaining compatibility with many different versions and flavours of OpenFOAM. He once quipped that he probably has more macros and ifdefs in swak4foam than actually code.
Having said that, you might also find that in the meantime you can solve your problem without swak4foam. If you only need a time-varying value boundary condition, you can define that as a uniformFixedValue (a bit of a misnomer in the meantime) with the value defined as a Function1 or PatchFunction1. This supports various types of input such as tables, common functions, coded functions.


Note that the swak4foam expressions were reimplemented in OpenFOAM-v1912, and lightly extended in OpenFOAM-v2012. So now you also have the option of using a swak-like expression for spatial-temporal conditions (eg, unformFixedValue) as well as for defining an exprMixed boundary condition.

The expressions also happen to be what powers the #eval dictionary directive.
Some docs:

gschaider and Daniel_Khazaei like this.
olesen is offline   Reply With Quote

Old   November 16, 2020, 09:58
Default
  #3
New Member
 
Join Date: Sep 2019
Posts: 12
Rep Power: 3
zhaohb11_cfd is on a distinguished road
Hi, DaniEng, do you install swak4foam in OF8 sucessfully?
zhaohb11_cfd is offline   Reply With Quote

Old   November 17, 2020, 03:22
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,199
Rep Power: 47
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zhaohb11_cfd View Post
Hi, DaniEng, do you install swak4foam in OF8 sucessfully?

Just came aware of this thread. swak4Foam compiles with OF8. Just not the released branch but the develop (which currently is stable. I just don't have the time to make the tests to call it a release). Just follow the instructions at the top of https://openfoamwiki.net/index.php/Contrib/swak4Foam just do the "hg update develop" before the Allwmake
Daniel_Khazaei and HappyS5 like this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 17, 2020, 06:33
Default
  #5
New Member
 
Join Date: Sep 2019
Posts: 12
Rep Power: 3
zhaohb11_cfd is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Just came aware of this thread. swak4Foam compiles with OF8. Just not the released branch but the develop (which currently is stable. I just don't have the time to make the tests to call it a release). Just follow the instructions at the top of https://openfoamwiki.net/index.php/Contrib/swak4Foam just do the "hg update develop" before the Allwmake
thanks, gschaider. I will give it a try.
zhaohb11_cfd is offline   Reply With Quote

Old   November 18, 2020, 09:47
Default
  #6
Member
 
ESI
Join Date: Sep 2017
Posts: 41
Rep Power: 5
ht2017 is on a distinguished road
Quote:
Originally Posted by zhaohb11_cfd View Post
thanks, gschaider. I will give it a try.
do you have success to install swak4foam on OF8? please teach me how to do it.
ht2017 is offline   Reply With Quote

Old   November 18, 2020, 19:12
Default
  #7
New Member
 
Join Date: Sep 2019
Posts: 12
Rep Power: 3
zhaohb11_cfd is on a distinguished road
Quote:
Originally Posted by ht2017 View Post
do you have success to install swak4foam on OF8? please teach me how to do it.
I have not installed swak4foam on OF8. I will try it recently. If sucessful, I will let you know.
zhaohb11_cfd is offline   Reply With Quote

Old   December 7, 2020, 11:05
Question Installation error
  #8
F42
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 5
F42 is on a distinguished road
Hello,

I tried to install swak4foam on OF8 with the commands suggested by B. Gschaider:

Code:
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam cd swak4Foam
hg update develop
./AllwmakeAll
However, I get the following error message:



Code:
/usr/bin/env: ‘python’: No such file or directory
/usr/bin/env: ‘python’: No such file or directory
In file included from ../filesThatAreOnlyInSomeDistributions/OutputFilerDropin/outputFilterOutputControl.C:26:
lnInclude/swak.H:48:2: error: #error "This swak4Foam-version is only used for the 2.x-versions of OpenFOAM. For lower versions there is a special branch"
   48 | #error "This swak4Foam-version is only used for the 2.x-versions of OpenFOAM. For lower versions there is a special branch"
      |  ^~~~~
make: *** [/home/user1/OpenFOAM/OpenFOAM-8/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/../filesThatAreOnlyInSomeDistributions/OutputFilerDropin/outputFilterOutputControl.o] Error 1
output above when building:


Code:
Reading variables from 'swakConfiguration'
Looking for Python 2
Looking for Python 3
Using our own Lua at /home/user1/OpenFOAM/swak4Foam/privateRequirements
Checking swak4Foam-version and generating file
hg info: 0dd63e72a56f (develop) tip
No 'bear' installed
Bison: /home/user1/OpenFOAM/swak4Foam/privateRequirements/bin/bison
Flex: /usr/bin/flex
Bison at /home/user1/OpenFOAM/swak4Foam/privateRequirements/bin/bison is version 3.4 (Major 3 Minor 4)
Flex is version 2.6.4 (Minor version: 4)
No swak4FoamParsers/foamVersion4swak.H. Generated
As far as I understand python is not necessary for building. Does anybody know what the problem is? I also tried it with v2006 with the same result.


Thanks in advance.
F42 is offline   Reply With Quote

Old   December 7, 2020, 17:01
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,199
Rep Power: 47
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by F42 View Post
Hello,

I tried to install swak4foam on OF8 with the commands suggested by B. Gschaider:

Code:
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam cd swak4Foam
hg update develop
./AllwmakeAll
However, I get the following error message:



Code:
/usr/bin/env: ‘python’: No such file or directory
/usr/bin/env: ‘python’: No such file or directory
In file included from ../filesThatAreOnlyInSomeDistributions/OutputFilerDropin/outputFilterOutputControl.C:26:
lnInclude/swak.H:48:2: error: #error "This swak4Foam-version is only used for the 2.x-versions of OpenFOAM. For lower versions there is a special branch"
   48 | #error "This swak4Foam-version is only used for the 2.x-versions of OpenFOAM. For lower versions there is a special branch"
      |  ^~~~~
make: *** [/home/user1/OpenFOAM/OpenFOAM-8/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/../filesThatAreOnlyInSomeDistributions/OutputFilerDropin/outputFilterOutputControl.o] Error 1
output above when building:


Code:
Reading variables from 'swakConfiguration'
Looking for Python 2
Looking for Python 3
Using our own Lua at /home/user1/OpenFOAM/swak4Foam/privateRequirements
Checking swak4Foam-version and generating file
hg info: 0dd63e72a56f (develop) tip
No 'bear' installed
Bison: /home/user1/OpenFOAM/swak4Foam/privateRequirements/bin/bison
Flex: /usr/bin/flex
Bison at /home/user1/OpenFOAM/swak4Foam/privateRequirements/bin/bison is version 3.4 (Major 3 Minor 4)
Flex is version 2.6.4 (Minor version: 4)
No swak4FoamParsers/foamVersion4swak.H. Generated
As far as I understand python is not necessary for building. Does anybody know what the problem is? I also tried it with v2006 with the same result.


Thanks in advance.

I'm afraid Python is necessary because it is used to generates some headers files automagically. It was never mentioned in the requirements as I hardly ever seen a Linux system without it (mostly because a lot of distros rely on it for their packaging system and other system tools). But the scripts in question don't mind if it Python 2 or 3


PS: which distro do you use that manages to live without Python? Just curious
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 8, 2020, 03:49
Default
  #10
F42
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 5
F42 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
I'm afraid Python is necessary because it is used to generates some headers files automagically. It was never mentioned in the requirements as I hardly ever seen a Linux system without it (mostly because a lot of distros rely on it for their packaging system and other system tools). But the scripts in question don't mind if it Python 2 or 3


PS: which distro do you use that manages to live without Python? Just curious

Thanks for your response,


I am using Ubuntu 20.04.1 with python 3.8.5 installed. When swak is ok with python3 then this shouldn´t be the problem, should it?
F42 is offline   Reply With Quote

Old   December 8, 2020, 17:37
Default
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,199
Rep Power: 47
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by F42 View Post
Thanks for your response,


I am using Ubuntu 20.04.1 with python 3.8.5 installed. When swak is ok with python3 then this shouldn´t be the problem, should it?

It is. If the python3 is also found as "python". Seems that this is not the case in the new Ubuntus. But there seems to be a package for that https://askubuntu.com/questions/1224...-20-04#1224710
F42 likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 9, 2020, 10:34
Smile
  #12
F42
New Member
 
Join Date: Jun 2018
Posts: 8
Rep Power: 5
F42 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
It is. If the python3 is also found as "python". Seems that this is not the case in the new Ubuntus. But there seems to be a package for that https://askubuntu.com/questions/1224...-20-04#1224710

you are right. Thanks! Ubuntu 20.04 is not shipped with python2 anymore.

Code:
sudo apt-get install python-is-python3
This package points to python3 when an application calls python. It seems to have solved the issue. At least the installation was succesful now.
It might be beneficial to add this information to the wiki as others will face the same error when trying to build on the newest Ubuntu.
F42 is offline   Reply With Quote

Old   May 27, 2021, 00:30
Default
  #13
New Member
 
Nipin L
Join Date: Nov 2012
Location: India
Posts: 7
Rep Power: 10
nipinl is on a distinguished road
I have installed swak4Foam in v2012 after installing

python-is-python3

in the following way,

hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam cd swak4Foam
hg update develop
./AllwmakeAll


During installation it complained for missing pythonInterpreterWrapper.H which then I copied from /opt/swak4Foam/Libraries/languageIntegration/swakPythonIntegration

Second time it complained missing Python.h file during the compiling process of funkyPythonPostproc.

Adding the path /usr/include/python3.8 to Make/option of funkyPythonPostproc gave another error as not recognizing "PyIntAsLong"

Finally, replacing the path by adding -I/usr/include/python2.7/ in the option file solved the issue.
nipinl is offline   Reply With Quote

Reply

Tags
compatibility, openfoam 8, swak4foam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 77 May 7, 2020 04:22
[swak4Foam] swak4foam openfoam 7 installation problem Andrea23 OpenFOAM Community Contributions 1 February 17, 2020 18:11
Getting Started with OpenFOAM wyldckat OpenFOAM 24 October 2, 2019 21:35
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 05:40
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 03:19


All times are GMT -4. The time now is 02:10.