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

[swak4Foam] problem with funkySetFields

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2011, 01:11
Default problem with funkySetFields
  #1
Member
 
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 14
lg88 is on a distinguished road
hi everyone
I need to set an initial field.but when i run the funkysetFields, i met the problem:

Create mesh for time = 0

Time = 0
Using funkySetFieldsDict

Part: a1
Putting "0" into field alpha1 at t = "0" if condition "sqrt(sqr(pos().x-4*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) <= 0.005" is true



--> FOAM FATAL ERROR:
Parser Error at "1.23" :"syntax error, unexpected ','"
"sqrt(sqr(pos().x-4*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) <= 0.005"
" ^ "

From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 718.


I don't kown how to deal with it?
Thank you for your help


Best regards.

lg88
lg88 is offline   Reply With Quote

Old   November 6, 2011, 08:13
Default
  #2
Member
 
jack
Join Date: Jul 2011
Posts: 52
Rep Power: 14
lg88 is on a distinguished road
This is my funkySetFieldsDict.


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object funkySetFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

expressions
(
a1
{
field alpha1;
expression_r "0";
condition "sqrt(sqr(pos().x-4*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) <= 0.005";
}

a2
{

field alpha1;
expression_r "1";
condition "sqrt(sqr(pos().x-2*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) > 0.005";
}
);

// ************************************************** *********************** //


now when i input the command :funkySetFieldsDict -time 0 ,the problem is different with the former one.The new one is :


--> FOAM FATAL IO ERROR:
keyword expression is undefined in dictionary "::a1"

file: ::a1 from line 22 to line 24.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting


what is the problem? Can you help me ?

Thank you very much


Best regards
lg88
lg88 is offline   Reply With Quote

Old   November 7, 2011, 09: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 lg88 View Post
hi everyone
I need to set an initial field.but when i run the funkysetFields, i met the problem:

Create mesh for time = 0

Time = 0
Using funkySetFieldsDict

Part: a1
Putting "0" into field alpha1 at t = "0" if condition "sqrt(sqr(pos().x-4*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) <= 0.005" is true



--> FOAM FATAL ERROR:
Parser Error at "1.23" :"syntax error, unexpected ','"
"sqrt(sqr(pos().x-4*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) <= 0.005"
" ^ "

From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 718.


I don't kown how to deal with it?
Thank you for your help


Best regards.

lg88
OK. The ^ points to the wrong location (which FSF-version are you using?). It should point to the "," in "(10,-2)". What is (10,-2) supposed to mean?
gschaider is offline   Reply With Quote

Old   November 7, 2011, 09:14
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 lg88 View Post
This is my funkySetFieldsDict.


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object funkySetFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

expressions
(
a1
{
field alpha1;
expression_r "0";
condition "sqrt(sqr(pos().x-4*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) <= 0.005";
}

a2
{

field alpha1;
expression_r "1";
condition "sqrt(sqr(pos().x-2*(10,-2))+sqr(pos().y-16*(10,-3))+(sqr(pos().z-5*(10,-3))) > 0.005";
}
);

// ************************************************** *********************** //


now when i input the command :funkySetFieldsDict -time 0 ,the problem is different with the former one.The new one is :


--> FOAM FATAL IO ERROR:
keyword expression is undefined in dictionary "::a1"

file: ::a1 from line 22 to line 24.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting


what is the problem? Can you help me ?

Thank you very much


Best regards
lg88
That is quite plain: It asks for a keyword "expression", you give it "expression_r1". Loose the _r1
gschaider is offline   Reply With Quote

Old   February 5, 2013, 07:37
Default Problem regarding funkySetFields
  #5
Member
 
Anant Diwakar
Join Date: Jan 2013
Posts: 68
Rep Power: 13
diwakaranant is on a distinguished road
Hi

I am using funkySetFields for initializing a exponential pressure distribution.
But when I am running the command "funkySetFields -time 0", the domain
is getting initialized correctly but the boundary conditions in the 0/p file is getting changed on its own.

Can anyone tell why is this happening ?

Thanks
Anant
diwakaranant is offline   Reply With Quote

Old   February 5, 2013, 13:33
Default
  #6
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 diwakaranant View Post
Hi

I am using funkySetFields for initializing a exponential pressure distribution.
But when I am running the command "funkySetFields -time 0", the domain
is getting initialized correctly but the boundary conditions in the 0/p file is getting changed on its own.

Can anyone tell why is this happening ?
You didn't read the docu. That happended

Probably you didn't set "keepPatches" http://openfoamwiki.net/index.php/Co...ctionary_usage
__________________
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

Reply

Tags
funkysetfields

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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 05:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 06:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 15:52


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