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 Community New Posts Updated Threads Search

Like Tree7Likes
  • 2 Post By olesen
  • 4 Post By gschaider
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2020, 21: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, 08:40
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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, 10:58
Default
  #3
New Member
 
Join Date: Sep 2019
Posts: 18
Rep Power: 7
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, 04:22
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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
__________________
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, 07:33
Default
  #5
New Member
 
Join Date: Sep 2019
Posts: 18
Rep Power: 7
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, 10:47
Default
  #6
Member
 
ESI
Join Date: Sep 2017
Posts: 49
Rep Power: 9
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, 20:12
Default
  #7
New Member
 
Join Date: Sep 2019
Posts: 18
Rep Power: 7
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, 12:05
Question Installation error
  #8
F42
New Member
 
Join Date: Jun 2018
Posts: 20
Rep Power: 8
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, 18:01
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 04:49
Default
  #10
F42
New Member
 
Join Date: Jun 2018
Posts: 20
Rep Power: 8
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, 18:37
Default
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 11:34
Smile
  #12
F42
New Member
 
Join Date: Jun 2018
Posts: 20
Rep Power: 8
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, 01:30
Default
  #13
New Member
 
Nipin L
Join Date: Nov 2012
Location: Canada
Posts: 23
Rep Power: 14
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

Old   June 8, 2022, 17:29
Default swak + OF8
  #14
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
Hi, I am also trying to get swak compiled for OF8.

I thought I got it compiled successfully (no actual errors), but I ended up with some strange errors when running a decomposed case w/ groovyBC and a timelines entry.

This same case ran fine 1) using OF6 + swak and 2) using OF8 + swak, in serial mode (no decomposition).

Upon inspection, I noticed the decomposed BC in the processor0/0 folder was incomplete - specifically the 'name' entry in timelines did not carry over to the decomposed folders.

I also noted that I got an error saying OF8 could not load libsimpleSwakFunctionObjects.so. But most all of the other library files could be found in the $FOAM_USER_LIBBIN.

Any thoughts?

Thanks!

-Clint
ecbmxer is offline   Reply With Quote

Old   June 14, 2022, 12:47
Default
  #15
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
Just to update this thread - I got swak to compile fine.

I did (3) things different and don't know which made it work. (I suspect #2)
1. I did NOT do hg update develop
2. I completely removed the swak4Foam directory and re-downloaded it (instead of just cleaning and remaking)
3. I did not change the name of the swak4Foam directory -I had previously been calling it swak4Foam_OF8, as I had a separate swak installation for OF6. I did not think this would matter, as it seems to detect the directory you are in. It also seemed OK when I recompiled swak for OF6 within swak4Foam_OF6.

BUT, none of this fixed the original issue I had.

My decomposed timelines entry (under groovyBC, OF8) looks like:

Code:
        timelines       (
{
        file            "$FOAM_CASE/H2frac.txt";
        format          foam;
}
But in OF6 it looks like:

Code:
        timelines       (
{
        name            XH2;
        file            "$FOAM_CASE/H2frac.txt";
        outOfBounds     clamp;
}
Which is exactly as I specified in my 0 directory. And so it errors out, complaining about not defining 'name'.
ecbmxer is offline   Reply With Quote

Old   August 25, 2022, 18:09
Default
  #16
New Member
 
Augusto
Join Date: Jul 2022
Posts: 1
Rep Power: 0
dlvld is on a distinguished road
I'm also facing problems installing Sweak4Foam with openFOAM 8.

I'm getting the following error.

Code:
Current OpenFOAM version is 8.
Previously compiled for OpenFOAM (8)

/home/agt/OpenFOAM/OpenFOAM-8/applications/swak4Foam/privateRequirements/bin existing. Prepending to PATH-variable (private version of Bison)

Reading variables from 'swakConfiguration'
Looking for Python 2
Looking for Python 3
Using our own Lua at /home/agt/OpenFOAM/OpenFOAM-8/applications/swak4Foam/privateRequirements
Checking swak4Foam-version and generating file
Swak version is 202x.yy.0
hg info: 481d96f16780 (develop) tip
Using /usr/bin/bear to build compilation database
Bison: /home/agt/OpenFOAM/OpenFOAM-8/applications/swak4Foam/privateRequirements/bin/bison
Flex: /usr/bin/flex
Bison at /home/agt/OpenFOAM/OpenFOAM-8/applications/swak4Foam/privateRequirements/bin/bison is version 3.4 (Major 3 Minor 4)
Flex is version 2.6.4 (Minor version: 4)
OpenFOAM-version: Major 8 Minor 0 Patch -1 (-1 == x / 98) Fork: org
No change to swak4FoamParsers/foamVersion4swak.H

Please include the output above when reporting a problem in the compilation. It helps diagnosing the problem


Unrecognized parameter: "--cdb=/home/agt/OpenFOAM/OpenFOAM-8/applications/swak4Foam/compile_commands.json"
Usage: bear [--output <arg>] [--verbose] -- ...
Parser library did not compile OK. No sense continuing as everything else depends on it
Could anyone help me? I didn't find the solution for this case.
dlvld is offline   Reply With Quote

Reply

Tags
compatibility, openfoam 8, swak4foam


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
Getting Started with OpenFOAM wyldckat OpenFOAM 26 June 21, 2024 07:54
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 09:06
[swak4Foam] swak4foam openfoam 7 installation problem Andrea23 OpenFOAM Community Contributions 1 February 17, 2020 19:11
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 06:40
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 04:19


All times are GMT -4. The time now is 15:18.