|
[Sponsors] |
April 12, 2013, 13:29 |
why pts() doesn't work?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
why does the statement:
Code:
"0<=pos().y && pos().y<=.0038 ? vector(0,0,0) : vector(mag(internalField(U).x),0,0)"; Last edited by immortality; April 15, 2013 at 12:42. |
|
April 14, 2013, 06:08 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Ehsan,
pos gives you the values in the face centres, whereas pts gives you the values in the vertices, hence they differ in size. This is probably the reason, why you only see that one of the methods work. Since your boundary condition is probably for a volume field, then it makes sense that it is pos, which works, since the boundary conditions for volume fields are given in the face centres. More information to be found here: http://openfoamwiki.net/index.php/Co...s_are_defined: Kind regards Niels |
|
April 14, 2013, 07:33 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
hi dear Niels
thanks But I used pts in a condition on y,does it have effect on fields?what are volume fields? When can use pts? |
|
April 14, 2013, 07:47 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
I do not understand this
Code:
But I used pts in a condition on y,does it have effect on fields?what are volume fields? I suppose you can e.g. use pts, if you are setting the pointDisplacement file for mesh motion. / Niels |
|
April 14, 2013, 07:49 |
|
#5 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
And with respect to your other question:
What are volume fields? OpenFoam solves all the equations using the finite volume method. Volume fields are those, where the variables are defined in the cell centres. This is opposed to e.g. surface fields, where the variables are defined on the surface of the computational cells. Examples: Volume fields: pressure, velocity, temperature, scalar transport Surface fields: face fluxes (phi) Kind regards Niels |
|
April 14, 2013, 10:38 |
|
#6 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thanks.then usage of pts() is restricted for example in moving meshes.right?
another question that maybe not related but I value the time to ask about difference between face zones and face sets or such concepts I asked before in another thread without result.and is patch a face zone or face set or is an independent thing? thanks. |
|
April 14, 2013, 12:04 |
|
#7 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi,
I would not constrain myself with pts() for mesh motion. All I said is that pts() can be used, when you are working with point locations rather than face locations. With respect to faces, faceSet and faceZones, I can tell you the following: 1. Faces on boundary faces are merely faces. The only special thing about them is that they only have an owner cell and not a neighbour cell. 2. A faceSet is a set of faces, which you can construct in many ways. In the more recent versions of OF, the pre-processing utility "topoSet" allows you to create faceSets. faceSets are NOT decomposed. 3. faceZones is a collection of faceSets, which you create by executing "setsToZones" after the sets are created. One major difference is that faceZones (as all the other zones, i.e pointZones and cellZones) are decomposed, when you are using decomposePar. Kind regards Niels |
|
April 14, 2013, 13:20 |
|
#8 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thank you for explaining faceSets and faceZones clearly.
but I have doubt on pts() yet.in contrib groovyBC an example is as so: Code:
inlet { type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; valueExpression "10*(1+0.5*sin(500*time()))*para"; value uniform (10 0 0); } Code:
"0<=pts().y && pts().y<=.0038 ? vector(0,0,0) : vector(mag(internalField(U).x),0,0)"; I haven't used pts() in volume fields (here U) then it shouldn't give any error.am I correct? |
|
April 14, 2013, 16:22 |
|
#9 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
The example you have from the groovyBC only uses the pts() to find the upper and lower limit of the boundary. When assigning values, it is pos(), which is being used, therefore, the example is consistent in terms of size of the different fields.
What you show, however,use the values of pts(), which on a 2-dimensional domain is more than twice as large as the internal field of U. The size of the internal field equals the number of faces on the boundary. Hence the error. An for the record: The velocity (U) is a volume field! / Niels |
|
April 14, 2013, 17:30 |
|
#10 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thanks.but i didn't figure out what you mean by "its more than twice as large as..." it seems vertices be only one number more than numbers of cell faces.
If we imagine a patch consisting of 3 cells it has three cell centers and four vertices.am not correct? And another thing in my code does OF assumes U values on vertices while they are located in cell centers,right?thenif i use toFace(vector(0,0,0)) it would be ok?did i grasp it correctly? |
|
April 15, 2013, 04:57 |
|
#11 | ||
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Quote:
Quote:
I suggest that you carefully read an introductory work to finite volume methods and/or an introduction to the basic principles in OpenFoam. Such a source for the latter could be chapter 3 in http://powerlab.fsb.hr/ped/kturbo/Op...jeJasakPhD.pdf Kind regards Niels |
|||
April 15, 2013, 05:57 |
|
#12 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
in parafoam we have 3 layers.is the middle main ?you mean 4 vertices in 3 layers?i think we should have 3*4 vertices not 2*4.wrong?
Then will it be correct if use toFace function? Thanks. |
|
April 15, 2013, 13:52 |
|
#13 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
could you please give me more clarification?
|
|
April 15, 2013, 13:57 |
|
#14 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Your post from earlier today is so difficult to read/understand that I have no means of answering it.
You have been encouraged to do it before, however, I will do it again: If you do not take your time in formulating your questions, you cannot expect answers. Kind regards, Niels |
|
April 15, 2013, 14:03 |
|
#15 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
I don't figure out how do you count vertices ?and also cell centers.
how vertex numbers wil be twice cell center numbers? I'm totally mixed up |
|
April 15, 2013, 14:12 |
|
#16 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
oh dear Niels I grasped it now.we should imagine cells as a cube not a rectangle.what a mistake!
then in the example we have 8 vertices and three cell centers. I always imagine it as rectangles! thank you so much. |
|
April 15, 2013, 14:16 |
|
#17 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Good.
/ Niels |
|
April 16, 2013, 06:04 |
|
#18 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
a question.when we assign boundary values does it set in boundary cell face or center?it seems U is located in face,right?then what about p and T?
And also whats the usge of faceSets and faceZones?when and where we need and use them? Thanks so much. |
|
April 16, 2013, 06:44 |
|
#19 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
faceSets and zones are only ways to keep track of "special" faces and are usually not used by the solver but by pre- and postprocessing tools
__________________
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 16, 2013, 11:41 |
|
#20 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thank you dear Bernard.
Only a small question about internalField and zeroGradient you mentioned at a good time! In internalField the value in the boundary cell "center" is replaced in the face of the cell that is boundary(not the neighbor cell center),right? And in zeroGradient same happens but implicitly,correct? |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to work with constant pressure? | Martin | Siemens | 2 | February 25, 2009 14:23 |
Getting FoamX to work | shaun | OpenFOAM Installation | 12 | March 23, 2007 09:55 |
work related to brake study of a vehical | aero | Siemens | 3 | November 23, 2006 08:43 |
Why do the Plant library cases don't work? | Alumna | Phoenics | 6 | June 22, 2004 13:08 |
why my In-Form doesn't work? | green | Phoenics | 2 | May 27, 2004 22:03 |