|
[Sponsors] |
[swak4Foam] how can use a property at a point in groovyBC? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2013, 06:44 |
how can use a property at a point in groovyBC?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
i want to use value of pressure at a point to set a boundary condition.more clear i need to set a p0,T0 boundary condition when shock is reached at the end of the channel.what command shouldp i use at fractionExpression?
|
|
January 23, 2013, 08:32 |
|
#2 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
You've got to use a "remote" variable (that can be calculated on sampled sets or patches. Your post does not make clear what you mean with "point"). The usage is described in my presentation from the 6th workshop (see the swak-page) and there are several examples in the swak4Foam-distribution
__________________
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 |
|
April 3, 2013, 07:28 |
|
#3 |
Member
Join Date: Nov 2012
Posts: 58
Rep Power: 13 |
Hello, I have more or less the same problem.
I would like to set the pressure on a patch equal to a fraction of the pressure in a specific point inside the domain. So far I was not able to finish the job just by looking at the fillingTheDam example. Below is what I have done so far. file 0/p: Code:
myPatch { type groovyBC; value uniform 10000; valueExpression "pinside/2."; storedVariables ( { name pinside; initialValue "10000"; } ); variables ( "pupstream=p;" ); } Code:
functions ( defineInsidePoint { type createSampledSet; outputControl timeStep; outputInterval 1; setName insidePoint; set { type cloud; axis x; points ( (1. 0. 0.) ); } } ... ); |
|
April 3, 2013, 07:58 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
pInside{set'insidePoint}=average(p);
__________________
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 |
||
April 3, 2013, 09:30 |
|
#5 |
Member
Join Date: Nov 2012
Posts: 58
Rep Power: 13 |
First of all thanks a lot for your answer, it was very helpful.
I have changed the pressure file as follows: Code:
myPatch { type groovyBC; value uniform 10000; variables ( "pinside{set'insidePoint}=average(p);" ); valueExpression "pinside/2."; } If I understand correctly, the average function indicates an averaging of the pressure values of the cells around the point only, right? |
|
April 3, 2013, 09:49 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
No. It's just a precaution. These "external variables" only allow one value. So if your set has more than one point it will do an arithmetic average of those and use that. In your case: the general expression for the average value of one value is left as an exercise to the reader
__________________
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 15, 2015, 06:40 |
|
#7 |
Member
Hrushi
Join Date: Jan 2013
Posts: 58
Rep Power: 13 |
Hi Bernhard,
Sorry, I am a bit late on this thread, but I have the same problem. I want to find out the value of alpha variable for a velocity boundary condition in openfoam and I need the value of alpha variable on the neighbouring face center. I know from documentation that I can find out the face center of the neighbouring cell using fn(), but can I use this information to find out value of alpha on that cell face for a velocity boundary condition? Regards, Hrushikesh |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam | dani2702 | OpenFOAM Community Contributions | 0 | November 17, 2016 03:30 |
CFD-post: defining (or projecting) point on surface | bongbang | CFX | 1 | April 1, 2015 12:16 |
[swak4Foam] groovyBC issue - k and epsilon | sagnikmazumdar | OpenFOAM Community Contributions | 24 | March 1, 2015 07:16 |
[blockMesh] How to use blockMesh to generate cylindrical T-junction | norkistar | OpenFOAM Meshing & Mesh Conversion | 2 | January 28, 2013 20:53 |
matching variable data with grid point data | anfho | OpenFOAM Programming & Development | 0 | May 6, 2011 15:28 |