|
[Sponsors] |
[swak4Foam] defining variables in funkySetFieldDict |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 5, 2012, 17:33 |
defining variables in funkySetFieldDict
|
#1 |
New Member
Victoria Suponitsky
Join Date: Jan 2011
Location: Vancouver
Posts: 5
Rep Power: 15 |
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 |
|
April 6, 2012, 07:08 |
|
#2 |
Senior Member
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19 |
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. |
|
April 9, 2012, 18:11 |
|
#3 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
April 9, 2012, 23:43 |
|
#4 |
New Member
Victoria Suponitsky
Join Date: Jan 2011
Location: Vancouver
Posts: 5
Rep Power: 15 |
Hello Bernhard,
Thanks a lot for your response. I indeed used the stand alone FSF version. Now with swak4Foam everything works. Thanks again, Victoria |
|
|
|
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 |