CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

SWAK4FOAM_SRC environment variable

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 15, 2012, 09:14
Default SWAK4FOAM_SRC environment variable
  #1
New Member
 
Felipe
Join Date: Feb 2011
Posts: 9
Rep Power: 6
fcuevas is on a distinguished road
Hi everybody,

I'm trying to run the CodeStream/cylinderWithSwak example included in swak4Foam library but I have this error

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Compilation of the function object only works if the environment variable SWAK4FOAM_SRC points to the Libraries directory of the swak4Foam-sources


From function swakCodedFunctionObject::read(const dictionary& dict)
in file swakCodedFunctionObject.C at line 225.

FOAM exiting
************************************************** ***

In the README file says for the swakFunctionObjects library: "... Assumes that the =SWAK4FOAM_SRC= environment variable is set to the Libraries=-directory of the =swak4Foam=-sources"

but I don't really know where/when can I set the environment variable (before I compile all swak4Foam or in the controlDictof the case that use this library or...)

The swak4Foam library is installed in $(WM_PROJECT_USER_DIR)/lib/swak4Foam and the compilation doesn't show any strange problem (as far as I know), actually I can use without problems the groovyBC library.

How and where should I set the environment variable?

Regards,
Felipe
fcuevas is offline   Reply With Quote

Old   June 15, 2012, 14:55
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by fcuevas View Post
Hi everybody,

I'm trying to run the CodeStream/cylinderWithSwak example included in swak4Foam library but I have this error

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
Compilation of the function object only works if the environment variable SWAK4FOAM_SRC points to the Libraries directory of the swak4Foam-sources


From function swakCodedFunctionObject::read(const dictionary& dict)
in file swakCodedFunctionObject.C at line 225.

FOAM exiting
************************************************** ***

In the README file says for the swakFunctionObjects library: "... Assumes that the =SWAK4FOAM_SRC= environment variable is set to the Libraries=-directory of the =swak4Foam=-sources"

but I don't really know where/when can I set the environment variable (before I compile all swak4Foam or in the controlDictof the case that use this library or...)

The swak4Foam library is installed in $(WM_PROJECT_USER_DIR)/lib/swak4Foam and the compilation doesn't show any strange problem (as far as I know), actually I can use without problems the groovyBC library.

How and where should I set the environment variable?

Regards,
Felipe
The thing is that the functionObject has to know where to find the swak4Foam-sources. As this is not standard-OF-software it depends on the user where it is installed and I didn't want to force anyone on a specific location (because usually 20% are not allowed to install it there because of administrative policies anyway ...) so the user has to give an indication by setting that environment variable. Setting an environment variable depends on the shell you're using. For the location you're giving and the shell I usually use (bash or zsh) you'd type
Code:
export SWAK4FOAM_SRC=$WM_PROJECT_USER_DIR/lib/swak4Foam/Libraries
for csh/tcsh it is setenv I think.

This variable is currently only needed for this functionObject as it is compiling something that requires the swak-headers. groovyBC and friends only need binaries (which you compiled at the start) and don't care where the sources are.

I'll add a test to the Allwmake that prints the proposed value for SWAK4FOAM_SRC

Where you actually set the environment variable (bashrc in your home, the site-configuration of OF, ...) is up to you
gschaider is offline   Reply With Quote

Old   June 18, 2012, 09:58
Default
  #3
New Member
 
Felipe
Join Date: Feb 2011
Posts: 9
Rep Power: 6
fcuevas is on a distinguished road
Set on bashrc, works perfectly

Regards,
Felipe
fcuevas is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
Environment variable in linux xinzhiyu2008 STAR-CCM+ 0 September 8, 2010 06:08
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas Main CFD Forum 1 May 30, 2008 04:35
Install Openfoam in Suse 100 setup environment h34gk1 OpenFOAM Installation 1 September 26, 2006 20:08
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 00:58.