|
[Sponsors] |
Assigning values to a cartesian grid from a binary image (or stl) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
August 5, 2014, 17:06 |
Assigning values to a cartesian grid from a binary image (or stl)
|
#1 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Dear all,
I stuck with the problem of assigning value to a field (let's call it alpha). Let's say I have a very fine cartesian grid generated with blockMesh and that I want to assign value to a field alpha defined on this grid in order to match the binary image shown below. The cells in the black region will have the value 1 and the cells in the white region will have the value alpha=0. I have a .stl file of this file and I am able to generate a grid with snappyHexMesh for either the black region. Then with mapField I can assign the value I want for alpha. However, the workflow is a little far-fetched. Do you think of a more direct way to assign this value? Using snappyHexMesh and this *.stl file to assign values to my field alpha defined on a cartesian grid ? Any ideas will be strongly appreciated. Cheers, Cyp |
|
August 5, 2014, 18:02 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Cyp,
I cannot check right here, but at least there is an option called surfaceToCellSet in some OF-version. In the more recent ones, I would expect that you can find it in connection with topoSet. Note, that when using surfaceToCellSrt you define a stl-surface and a number of points. These are either inside or outside of the STL (additional flags), but the important thing is that you will probably need a lot of points, because the STL is by no means convex. You might even be able to use surfaceToCell directly inside setField? Good luck, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simulating square cylinder using cartesian grid? | zonexo | Main CFD Forum | 5 | October 10, 2005 08:12 |
cartesian grid generation method | Abu Taleb | Main CFD Forum | 7 | April 14, 2001 09:49 |
Cartesian grid generation method | Abu Taleb | Main CFD Forum | 0 | April 8, 2001 12:15 |
Cartesian grid generation method | Abu Taleb | Main CFD Forum | 0 | April 8, 2001 12:03 |
Grid Independent Solution | Chuck Leakeas | Main CFD Forum | 2 | May 26, 2000 11:18 |