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

Problem with funkySetFields: How to set field on patch?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 3, 2011, 13:53
Default Problem with funkySetFields: How to set field on patch?
  #1
New Member
 
Join Date: Nov 2009
Location: Germany
Posts: 8
Rep Power: 7
DanielPT is on a distinguished road
Hello,

I have some problems with funkySetFields. I want to set a fully developed velocity profile on my inlet.
But after running funkySetFields -time 0 the file 0/U contains a filed for the whole mesh and my entry for Inlet is even the entry before using FSF.

My funkySetFieldsDict:

surface
{
field U;
expression.....
valuePatches (inlet);
keepPatches 0;
}

Thanks and regards
Daniel
DanielPT is offline   Reply With Quote

Old   March 3, 2011, 17:44
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by DanielPT View Post
Hello,

I have some problems with funkySetFields. I want to set a fully developed velocity profile on my inlet.
But after running funkySetFields -time 0 the file 0/U contains a filed for the whole mesh and my entry for Inlet is even the entry before using FSF.

My funkySetFieldsDict:

surface
{
field U;
expression.....
valuePatches (inlet);
keepPatches 0;
}

Thanks and regards
Daniel
Hmmm. You tried to do it by hand like it is described in http://openfoamwiki.net/index.php/Co...t-Room_Example (BTW: of course you'll need a second expression to clear the internal field). What type is inlet. I think it has to be a fixedValue-patch if FSF should be able to set values there.

Bernhard

PS: for just setting patch-values there is a utility funkySetBoundaryFields in the swak4Foam-suite.
gschaider is offline   Reply With Quote

Old   May 5, 2011, 05:49
Default
  #3
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 66
Rep Power: 5
alfa_8C is an unknown quantity at this point
...referring to the last post:

FunkySetFields for OF 141

Ok, Berhard. Now it works really well!! Thank you.

But there is one further I don't understand so far. If I apply the following expression:

"faceAverage(fpos().z <= surf(3.) ? surf(1.0) : surf(0.))"

the red part determines at which height the free surface will be set - in this case at 3m. This is ok for simply horizontal initial free surfaces.

In the case I want to apply an inital free surface that varies over lenght i.e. along a slope (pic illustrates the problem), I have to insert a linear function f(z)=m*x+n. But the expression doesn't accept this:


"faceAverage(fpos().z <= surf(-m*pos().x+n) ? surf(1.0) : surf(0.))"

Whereas the condition accepts it without any problem.

Is there any solution for this problem?
alfa_8C is offline   Reply With Quote

Old   May 5, 2011, 11:41
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by alfa_8C View Post
...referring to the last post:

FunkySetFields for OF 141

Ok, Berhard. Now it works really well!! Thank you.

But there is one further I don't understand so far. If I apply the following expression:

"faceAverage(fpos().z <= surf(3.) ? surf(1.0) : surf(0.))"

the red part determines at which height the free surface will be set - in this case at 3m. This is ok for simply horizontal initial free surfaces.

In the case I want to apply an inital free surface that varies over lenght i.e. along a slope (pic illustrates the problem), I have to insert a linear function f(z)=m*x+n. But the expression doesn't accept this:


"faceAverage(fpos().z <= surf(-m*pos().x+n) ? surf(1.0) : surf(0.))"

Whereas the condition accepts it without any problem.

Is there any solution for this problem?
What do you mean with "Whereas the condition accepts it without any problem"? In real life of course you use values for m and n?

What is the error message? Without it I can't do much and I don't have the time to test the expressions "by hand"

BTW: If thing the better variant (I'm doing this from memory the syntax might be slightly different) would be in my opinion "<= surf(42.)+fpos().x*surf(13.)" with the values 13 and 42 for m and n
gschaider is offline   Reply With Quote

Old   May 6, 2011, 09:45
Default
  #5
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 66
Rep Power: 5
alfa_8C is an unknown quantity at this point
...the problem is solved. Your hint....

BTW: If thing the better variant (I'm doing this from memory the syntax might be slightly different) would be in my opinion "<= surf(42.)+fpos().x*surf(13.)" with the values 13 and 42 for m and n

led me to the solution. It was just a synthax error.

Thank you Bernhard!!

Best, Toni
alfa_8C is offline   Reply With Quote

Reply

Tags
boundary, fsf, funkysetfields, patch

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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
conjugateHeatFoam:given field does not correspond to patch dinonettis OpenFOAM 1 April 30, 2010 13:40
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
Problem in installation of OpenFOAM sachin OpenFOAM Installation 7 January 22, 2008 02:40


All times are GMT -4. The time now is 08:41.