CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   using toPoints at funkySetFields (http://www.cfd-online.com/Forums/openfoam/99825-using-topoints-funkysetfields.html)

fisch April 12, 2012 11:36

using toPoints at funkySetFields
 
Hi,

I try using the toPoints Method for initialising my pointMotionU field because if i don't do it the following error occurs:
Code:

--> FOAM FATAL ERROR:
 inconsistent types: pointMotionU is  pointVectorField while the expression evaluates to a volVectorField

    From function doAnExpression()
    in file funkySetFields.C at line 328.

So i think i should use the toPoints(...) function in my funkySetFieldsDict like
Code:

      setPointMotionUstart
    {
        field pointMotionU;
        expression "vector(toPoint(0),toPoint(0.5e-1) * toPoint(pi) * (toPoint(0.1e1) - toPoint(pos().y)),toPoint(0)) ";
        keepPatches true;
    }

But now, the following error occurs:
Code:

--> FOAM FATAL ERROR:
 Parser Error at "1.8-14" :"field toPoint not existing or of wrong type"
"vector(toPoint(0),toPoint(0.5e-1) * toPoint(pi) * (toPoint(0.1e1) - toPoint(pos().y)),toPoint(0)) "
"        ^^^^^^^                                                                                  "

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

FOAM exiting

Is there some mistake on my side or is it simply not possible to work like this??

Is it maybe something for the mantis bugtracker?

Thanks a lot

gschaider April 12, 2012 18:48

Quote:

Originally Posted by fisch (Post 354411)
Hi,

I try using the toPoints Method for initialising my pointMotionU field because if i don't do it the following error occurs:
Code:

--> FOAM FATAL ERROR:
 inconsistent types: pointMotionU is  pointVectorField while the expression evaluates to a volVectorField

    From function doAnExpression()
    in file funkySetFields.C at line 328.

So i think i should use the toPoints(...) function in my funkySetFieldsDict like
Code:

      setPointMotionUstart
    {
        field pointMotionU;
        expression "vector(toPoint(0),toPoint(0.5e-1) * toPoint(pi) * (toPoint(0.1e1) - toPoint(pos().y)),toPoint(0)) ";
        keepPatches true;
    }

But now, the following error occurs:
Code:

--> FOAM FATAL ERROR:
 Parser Error at "1.8-14" :"field toPoint not existing or of wrong type"
"vector(toPoint(0),toPoint(0.5e-1) * toPoint(pi) * (toPoint(0.1e1) - toPoint(pos().y)),toPoint(0)) "
"        ^^^^^^^                                                                                  "

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

FOAM exiting

Is there some mistake on my side or is it simply not possible to work like this??

Is it maybe something for the mantis bugtracker?

Thanks a lot

Due to historical reason (groovyBC and funkySetFields started out as two different projects) there are inconsistencies between the two grammars. In the field grammar there is

- "point(3.4)" this only works for a scalar (no expressions or anything)
- "interpolateToPoint(0.1e1-pos().y)" this works for any expression

Yes. A Mantis bug "Clean up this unholy mess in the grammars" might speed this up (although your immediate problem should be solved)

mecman August 4, 2013 05:59

Hi all
i want use of FunkySetFields for may case in OpenFoam2.1.1,i instal swak4Foam for this version witout problem,i made FunkySetFieldsDict for my case and after when i run that i see this problem

--> FOAM FATAL ERROR:
funkySetFields: time/latestTime option is required
From function main()
in file funkySetFields.C at line 641.
FOAM exiting
what is my mistake?

gschaider August 4, 2013 13:20

Quote:

Originally Posted by mecman (Post 443697)
Hi all
i want use of FunkySetFields for may case in OpenFoam2.1.1,i instal swak4Foam for this version witout problem,i made FunkySetFieldsDict for my case and after when i run that i see this problem

--> FOAM FATAL ERROR:
funkySetFields: time/latestTime option is required
From function main()
in file funkySetFields.C at line 641.
FOAM exiting
what is my mistake?

Please don't post the same question in multiple threads and don't hijack threads whose topic is not related to your problem (which could have been easily solved by actually READING the error message)

mecman August 4, 2013 13:28

Quote:

Originally Posted by gschaider (Post 443756)
Please don't post the same question in multiple threads and don't hijack threads whose topic is not related to your problem (which could have been easily solved by actually READING the error message)

Sorry man...::(:(:(


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