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

[swak4Foam] defining variables in funkySetFieldDict

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 5, 2012, 17:33
Default defining variables in funkySetFieldDict
  #1
New Member
 
Victoria Suponitsky
Join Date: Jan 2011
Location: Vancouver
Posts: 5
Rep Power: 15
supvika is on a distinguished road
Hello,

I would like to define some variables and use them in the evaluation of 'expression' in 'funkySetFieldsDict'. I added it according to the example in www.openfoamworkshop.org/6th...2011/.../gschaider_slides.pdf as:

setCircle
{
field alpha1 ;
keepPatches true ;
expression "width" ;
variables (
"width=max(pos().x)-min(pos().x);"
);
}


When I run funkySetFields the following error message always happens:

Create time
Create mesh for time = 0
Time = 0
Using funkySetFieldsDict

Part: setCircle
Putting "width" into field alpha1 at t = "0" if condition "true" is true
Keeping patches unaltered

--> FOAM FATAL ERROR:
Parser Error at "1.0-4" :"field width not existing or of wrong type"
"width"
"^^^^^"

From function parsingValue
in file ValueExpressionDriver.C at line 84.

FOAM exiting


I will be very gratefull if somebody can help me to resolve this issue. Just to make sure, without attempting to define the variables funkySetFiles works fine. I am using OF1.7.

Thanks,
Victoria
supvika is offline   Reply With Quote

Old   April 6, 2012, 07:08
Default
  #2
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19
eelcovv is on a distinguished road
I wonder if your definition for width does not give 0 as a outcome, since you take the max of the local x-position (which is equal to the local x-position) and subtract the min of the local x-position (which is again equal to the local x-position).

Apart from that, it complains about the type of the field, perhaps that the type definition in your alpha1 field is not set to volScalarField.

For the rest I don't see anything wrong in your syntax, so it should work.
eelcovv is offline   Reply With Quote

Old   April 9, 2012, 18:11
Default
  #3
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 supvika View Post
Hello,

I would like to define some variables and use them in the evaluation of 'expression' in 'funkySetFieldsDict'. I added it according to the example in www.openfoamworkshop.org/6th...2011/.../gschaider_slides.pdf as:

setCircle
{
field alpha1 ;
keepPatches true ;
expression "width" ;
variables (
"width=max(pos().x)-min(pos().x);"
);
}


When I run funkySetFields the following error message always happens:

Create time
Create mesh for time = 0
Time = 0
Using funkySetFieldsDict

Part: setCircle
Putting "width" into field alpha1 at t = "0" if condition "true" is true
Keeping patches unaltered

--> FOAM FATAL ERROR:
Parser Error at "1.0-4" :"field width not existing or of wrong type"
"width"
"^^^^^"

From function parsingValue
in file ValueExpressionDriver.C at line 84.

FOAM exiting


I will be very gratefull if somebody can help me to resolve this issue. Just to make sure, without attempting to define the variables funkySetFiles works fine. I am using OF1.7.
Just tried your expression and it works fine for me. Which version of FSF are you using? Only the ones that come with swak4Foam (not the standalone) support variables
gschaider is offline   Reply With Quote

Old   April 9, 2012, 23:43
Default
  #4
New Member
 
Victoria Suponitsky
Join Date: Jan 2011
Location: Vancouver
Posts: 5
Rep Power: 15
supvika is on a distinguished road
Hello Bernhard,

Thanks a lot for your response. I indeed used the stand alone FSF version.
Now with swak4Foam everything works.

Thanks again,
Victoria
supvika is offline   Reply With Quote

Reply


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
Accessing other variables in defining boundary condition Cynthia Poon OpenFOAM Running, Solving & CFD 1 September 27, 2021 06:28
[swak4Foam] How to define boundary condition variables by using previosly defined variables? pawlo OpenFOAM Community Contributions 8 September 13, 2020 11:37
[swak4Foam] Defining two different variables at two patch in groovyBC with the same name immortality OpenFOAM Community Contributions 2 January 9, 2013 18:03
Defining additionally variables of U in OF 1.6 lentschi OpenFOAM 3 March 7, 2011 09:10
Defining New Variables Tim Phoenics 0 September 30, 2003 14:52


All times are GMT -4. The time now is 19:46.