# Initial Condition for alpha (VOF) using funkySetFields/swak4Foam

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

 July 29, 2013, 07:04 Initial Condition for alpha (VOF) using funkySetFields/swak4Foam #1 New Member   Stefan Hildenbrand Join Date: Aug 2009 Location: Stuttgart, Germany Posts: 20 Rep Power: 7 Hi all, I have following problem: I want to simulate how a liquid runs out of a (car) door sill. The door sill is kind of box-shaped, but unfortunately only kind of: The left and the right side have different heights, the left side and right side are not perpendicular to the bottom, with each side being differently. Unfortunately I am not allowed to post picture here. The door sill itself is located in a larger box which is my computational area. I now want to impose a initial condition for alphawater such that the door sill is filled to a certain percentage with my liquid. Basically I need to know which cell is inside the door sill and which cell is outside. I generate my mesh using snappyHexMesh and reading in STL data. With funkySetFields I can make a logical expression in the form of "(pos().x > 1.487) && (pos().x < 3.052)" [...] but that is not sufficient. Any ideas anyone? Thanks, Stefan

July 29, 2013, 13:14
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
Quote:
 Originally Posted by shildenbrand Hi all, I have following problem: I want to simulate how a liquid runs out of a (car) door sill. The door sill is kind of box-shaped, but unfortunately only kind of: The left and the right side have different heights, the left side and right side are not perpendicular to the bottom, with each side being differently. Unfortunately I am not allowed to post picture here. The door sill itself is located in a larger box which is my computational area. I now want to impose a initial condition for alphawater such that the door sill is filled to a certain percentage with my liquid. Basically I need to know which cell is inside the door sill and which cell is outside. I generate my mesh using snappyHexMesh and reading in STL data. With funkySetFields I can make a logical expression in the form of "(pos().x > 1.487) && (pos().x < 3.052)" [...] but that is not sufficient. Any ideas anyone? Thanks, Stefan
Sorry. Without even a sketch it's hard to understand what you're saying.

And in case of "I am not allowed to post of picture here" consider getting a support contract with someone who can help you. The topic (car) and the town (Stuttgart) suggest that you're not working for someone who can't afford it
__________________
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

July 29, 2013, 13:37
#3
New Member

Stefan Hildenbrand
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 7
Quote:
 Originally Posted by gschaider Sorry. Without even a sketch it's hard to understand what you're saying. And in case of "I am not allowed to post of picture here" consider getting a support contract with someone who can help you. The topic (car) and the town (Stuttgart) suggest that you're not working for someone who can't afford it
Ok you're right. Without a sketch - hard to understand. So I tried this sketch (cut through the configuration):IMG_0310.jpg

And by the way - no- I am not working for the company you are assuming, neither directly nor doing project work for them.

 July 30, 2013, 04:19 #4 Senior Member     Anton Kidess Join Date: May 2009 Location: Delft, Netherlands Posts: 912 Rep Power: 16 Much better. Is the outer basin essential, or could you just drain into "infinity" instead? __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. *Check out the scientific computing exchange http://scicomp.stackexchange.com

 July 30, 2013, 04:33 #5 New Member   Stefan Hildenbrand Join Date: Aug 2009 Location: Stuttgart, Germany Posts: 20 Rep Power: 7 Hi Anton, for the first period of the process (which is the draining part) it is not necessary, for the second period (when the last drops come out) I need at least the bottom side. Stefan

 July 30, 2013, 04:40 #6 Senior Member     Anton Kidess Join Date: May 2009 Location: Delft, Netherlands Posts: 912 Rep Power: 16 An idea might be to just have the door sill alone and initialize it, and then use mapfields to a domain containing the outer box. __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. *Check out the scientific computing exchange http://scicomp.stackexchange.com

July 30, 2013, 04:59
#7
New Member

Stefan Hildenbrand
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 7
Quote:
 Originally Posted by akidess An idea might be to just have the door sill alone and initialize it, and then use mapfields to a domain containing the outer box.
I thought about that, too, but the problem is that the door sill has many holes and gaps. If I tried to mesh it separately, I'd have to close all holes.

July 30, 2013, 06:56
#8
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
Quote:
 Originally Posted by shildenbrand I thought about that, too, but the problem is that the door sill has many holes and gaps. If I tried to mesh it separately, I'd have to close all holes. I think about it again - thanks for your idea!
Is there a way to mark the "inner" region in the mesher and then write it out as a cellZone/cellSet? Because then setting the liquid only inside would be as simple as "(zone(inner) && pos().z<maxZ && pos().z>minZ) ? 1 : 0"
__________________
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

 July 30, 2013, 10:09 #9 New Member   Stefan Hildenbrand Join Date: Aug 2009 Location: Stuttgart, Germany Posts: 20 Rep Power: 7 I have tried the following: Wrap the door sill only with large meshsize (-> holes get closed), use convex hull (-> really big holes get closed). This gave me a coarse closed volume, which I could use in snappyHexMesh. Next steps: - funkySetFields (as before, only looking at the z-axis) - mapFields to my "old" fine case When looking now at my initial solution at t=0 I am quiet happy with the result. However, my computation now diverges quickly (which did not happen before - my previous initialization were two approximated boxes with different height). @Bernhard: I have found no way to generate a cellset of the inside of the door sill - so far I tried only opensource-software to prepare the surfaces and SHM to generate a volume mesh. Thanks for you answers, I have now a better initial condition - although a different new problem

July 30, 2013, 13:01
#10
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
Quote:
 Originally Posted by shildenbrand @Bernhard: I have found no way to generate a cellset of the inside of the door sill - so far I tried only opensource-software to prepare the surfaces and SHM to generate a volume mesh.
SHM has the ability to generate cellZones. See the snappyHeater (or so) tutorial
__________________
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

 August 2, 2013, 05:08 #11 New Member   Stefan Hildenbrand Join Date: Aug 2009 Location: Stuttgart, Germany Posts: 20 Rep Power: 7 Hi all, just a quick update: I've played around with cellSets (separately or within SHM) but none of this seems to work in my case. The (as of today) best way to generate an initial condition for alphawater seems to be: - generate a closed version of the door sill - funkySetFields with pos().z < - go to the "big" case - mapFields - funkySetBoundaryField with expression "internalField(alphawater)" --> the liquid looks pretty good afterwards, unfortunately I get convergence problems due to the mapping (I assume) Stefan P.S. Is there any way to include the boundary condition "constantAlphaContactAngle" within swak4Foam?

August 2, 2013, 06:24
#12
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
Quote:
 Originally Posted by shildenbrand P.S. Is there any way to include the boundary condition "constantAlphaContactAngle" within swak4Foam?
What do you mean with "include"?
__________________
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

August 2, 2013, 07:38
#13
New Member

Stefan Hildenbrand
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 7
Quote:
 Originally Posted by gschaider What do you mean with "include"?
If I use funkySetFields on 0/alphawater, where I use the BC (for example)

{
type constantAlphaContactAngle;
theta0 50;
value uniform 0;
}

funkySetFields complains about the used type, gives me a overview about the correct ones (e.g. zeroGradient and some 50 others) and stops. I have to change the type to zeroGradient, use funkySetFields, and switch back to constantAlphaContactAngle.

By "include" I mean: How and where do I include \$FOAM_SRC/transportModels/twoPhaseProperties/lnInclude such that funkySetFields does not complain anymore?

August 3, 2013, 05:34
#14
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
Quote:
 Originally Posted by shildenbrand By "include" I mean: How and where do I include \$FOAM_SRC/transportModels/twoPhaseProperties/lnInclude such that funkySetFields does not complain anymore?
Thanks for the clarification. But you see the point? It was clear to you because you were confronted with the problem before you wrote that posting. But everyone else is lacking that context. You wouldn't be happy with the answer "That is OK. The boundary condition is not in the runtime-selection table" instead of the one below (and there ARE people who'd confronted with that answer would say "Ah. Of course. Libs in controlDict. Only have to find the right library")

Quote:
 Originally Posted by shildenbrand If I use funkySetFields on 0/alphawater, where I use the BC (for example) Schweller_Schweller_links { type constantAlphaContactAngle; theta0 50; limit gradient; value uniform 0; } funkySetFields complains about the used type, gives me a overview about the correct ones (e.g. zeroGradient and some 50 others) and stops. I have to change the type to zeroGradient, use funkySetFields, and switch back to constantAlphaContactAngle.
The "problem" is that constantAlphaContactAngle is a "special" boundary condition that is not present in the finiteVolume library. And FSF only links against this (would be hard to link it against every library that holds some boundary conditions). The good new is that you can "inject" additional BCs if they are in a library: just add that library to the libs-list in the controlDict then the runtime-selection-table will know about it and FSF can read and write this BC. The name of the library that has this boundary condition starts with "libtwoPhase" (which it is differs between OF-versions. Have a look in \$FOAM_LIBBIN and experiment)
__________________
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

 August 5, 2013, 05:55 #15 New Member   Stefan Hildenbrand Join Date: Aug 2009 Location: Stuttgart, Germany Posts: 20 Rep Power: 7 Thank you very much for your help - it actually was "libtwoPhaseProperties.so" I had to declare in my controlDict. You're right about the description of the problem (in text or by a sketch). I'll try my very best in the future.

 August 6, 2013, 03:44 #16 New Member   Stefan Hildenbrand Join Date: Aug 2009 Location: Stuttgart, Germany Posts: 20 Rep Power: 7 Hi all, my final comment for future reference. The way I get my computation converging is slightly different as posted above. It is - generate a closed version of the door sill - funkySetFields with pos().z < - go to the "big" case - mapFields - generate cellZone of cells near walls of door sillfaceSet f0 new patchToFace cellSet c0 new faceToCell f0 any cellZoneSet c0Zone new setToCellZone c0- use funkySetFields with condition "(zone(c0Zone))" to set alpha=0 there - run case Apparently my divergence problems came from alpha=1 at some outlet holes in the door sill. Thanks again for the help. Stefan

 Tags compressibleinterfoam, funkysetfield, setfields

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33 Industrial_CFD OpenFOAM Running, Solving & CFD 21 February 24, 2013 15:39 Lord Kelvin OpenFOAM 6 April 12, 2011 11:24 lordvon OpenFOAM 14 October 27, 2010 11:13 sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 04:32

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