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

[swak4Foam] Problem with funkySetFields: How to set field on patch?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: 17
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: 4,225
Rep Power: 51
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, 06:49
Default
  #3
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15
alfa_8C is an unknown quantity at this point
...referring to the last post:

http://www.cfd-online.com/Forums/ope...tml#post306326

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, 12:41
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 alfa_8C View Post
...referring to the last post:

http://www.cfd-online.com/Forums/ope...tml#post306326

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, 10:45
Default
  #5
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15
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


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
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) Aadhavan OpenFOAM Meshing & Mesh Conversion 2 March 8, 2018 02:47
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 10:53
[GAMBIT] periodic faces not matching Aadhavan ANSYS Meshing & Geometry 6 August 31, 2013 12:25


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