|
[Sponsors] |
June 30, 2010, 10:28 |
Defining different "zones" in the same mesh
|
#1 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Hello, I have a very simple wedge in which i would like to define 3 different conductivities. I could modify my case solver, but i dont know the command for it to check the x positions, i have something like this:
forAll(mesh.cells(),cellI) { if (x>0.0105) {k[cellI]=1;} if (x>0.0125) {k[cellI]=0;} } mind you, that is what i want to do. For that position in the x axis, change k (heat conductivity) for all the cells. IF it helps, or doesnt help, i have the regions clearly defined in the mesh (the boundary conditions are different for every zone). Maybe with funkysetfields its easier? Many thanks! GB --------UPDATE--------- i tried doing this: forAll(mesh.cells(),cellI) { if (pos().x>0.0105 & pos().x<=0.0125) {k[cellI]=0.2;} if (pos().x>0.0125) {k[cellI]=0.17;} } and im getting make error 1 when i try to compile the solver. Obviously, something is wrong with those lines. What could it be? I know i will keep hunting. Last edited by Disco_Caine; June 30, 2010 at 10:54. Reason: update |
|
June 30, 2010, 10:46 |
|
#2 | ||
Member
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17 |
Quote:
Code:
forAll (mesh.cellCentres(), cellI) { if (mesh.cellCentres()[cellI].x() > 0.0105) k[cellI] = 1; // etc. } Quote:
|
|||
June 30, 2010, 11:15 |
|
#3 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Well, with your code sintax it compiled. I will see if it did the trick and update the results briefly.
|
|
July 2, 2010, 10:59 |
|
#4 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
I've managed to get a simulation running, however, i am now having a bit of trouble with the preprocessing part. I suppose i can keep this thread going rather than make a new one.
A small introduction: As i said before, my mesh (an axisymmetric wedge) has 3 blocks. Now for 2 blocks i wanted to set different properties. And for the other block, i want to set different initial boundary conditions, and for that i am using funkySetFields (which is awesome by the way). Ok, so my mesh is bi dimensional ( x and z) and this is what i wanna set up: temperature1 { field T; expression "52.96281*(pow(pos().z,0.262054))+273"; conditions "(pos().x < 0.0105)"; keepPatches 1; } It looks correct enough, the dimensions all match, the cell points make sense, etc. But its setting the field to the whole mesh, its clearly not following my condition (because, most likely, its written incorrectly). So i tried setting that field for that box, and then another field for the rest of the mesh, and it would just put this second field everywhere. What am i doing wrong? Im really stuck on that. Thanks! |
|
July 2, 2010, 13:56 |
|
#5 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Ok, i am having serious problems defining anything for a given part of my mesh. And i believe its those pos().x conditions that are confusing me. Anyways, the situation right now is, in my solver i have this cell operation, but i wanna restrict to a particular set of cells. so i tried this (ill show the before and after):
before: forAll(mesh.cells(),cellI) { bla bla bla after: forAll(mesh.cells(),cellI) { if (mesh.cellCentres()[cellI].x() < 0.0105) { bla bla bla;} } But now, its like my solver isnt doing anything. In paraFoam i can clearly see that x goes from 0 to 0.12, why doesnt it work? Any hints? Sintax issues? Thanks! |
|
July 2, 2010, 14:26 |
|
#6 |
Member
G B
Join Date: Mar 2010
Posts: 37
Rep Power: 16 |
Update: the solver condition works! It was just a panic attack. Still no luck with funkySetFields, ill try setting the field in the solver.
Im sorry for the annoying number of posts, at least its only in this thread. |
|
September 24, 2010, 06:27 |
convertToMeters set?
|
#7 |
Senior Member
|
I do not know if that is the case here (and especially for funkySetFields), but:
If the different value goes everywhere within your domain, you should check if there is some measuring unit thingy in it. E.g. I used blockMesh which usually uses meters as measuring unit. But it is also possible to use ¨convertToMeters¨, defining a conversion factor. Point is: The conversion factor is used with blockMesh. But it is not used within setFields. So perhaps it is already the problem of one missing 0 (like 0.0105 instead of 0.00105) that could cause setFields being off-limits... As I said: That was my experience with setFields, but perhaps it is the same for funkySetFields. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D Hybrid Mesh Errors | DarrenC | ANSYS Meshing & Geometry | 11 | August 5, 2013 07:42 |
[Salome] unv mesh corrupted after createPatch | maddalena | OpenFOAM Meshing & Mesh Conversion | 1 | February 18, 2010 08:43 |
dynamic mesh without defining deforming zone | erkan gunaydinoglu | FLUENT | 0 | November 30, 2008 10:03 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
basic of mesh refinement | arya | CFX | 4 | June 19, 2007 13:21 |