https://linen.dev logo
cUStoM SkETheCs
# meshing
f
quarter disc
f
@BoredAbi
I am not doing anything, I am just going to be looking people struggle (jk)
k
"subscribe"
TO PAIN
f
Start somewhere, draw on paper what you would like and try divide it into blocks
b
yeah, im gonna start doing it in a step by step manner
then scale it up paramertically somehow
f
I would recommend to make a 2D sketch
f
Hey thats my hex
But it is quite different then what i did
I am not sure how those triangular faces will look like later on
But it also has some optimization for the edge blocks and some reposition of vertices
That does not look like a wing?
b
Wing?
Uhh theyre supposed to be all quads, looks like a trig im aware
Hmm
Do you think i should just find a way to do it in salome?
I need to create an interface
f
I mean airfoil
I am not sure what you want
b
Im doing an FSI study, so there is a interface patch that needs to fit to the solid part of the mesh -- the perforated disk So its essentially like a coating So in blockmesh i can create these patches somewhat easily
f
a perforated disc is pretty much my mesh
🙂
let me draw my sketch rq
Depending on how close the hole is to the curved edge you have two options
ah I even misdrew it 1 sec, now we have a block with 5 points oopsie
@BoredAbi
b
hmm
okay this mkaes more sense
lemme see if i can implement it
man if only classy had boolean operations
VOXELS
f
arma 1
f
you can do it, now cloudflare is down you got nothing better to do
b
Im a eng student, i have nothing else to do anyways
:(
f
Writing papers
without sources as cloudflare is down
b
Make random claims while writing paper Feed it to chat gpt and ask it to create references 😁 This is how i will write papers in 2026
f
When removing the cylinder from the center in a wrapped disk it loses its curvature, quite logical as the edges are removed that the other ones follow https://cdn.discordapp.com/attachments/1446061956048883835/1452588014600458361/image.png?ex=694a5b82&is=69490a02&hm=44f486897466fea047d82a9af24f29f633d85d49dfb81d004a2dc74b7a93daa0&
but in my other code it does work
b
man i have to do this somehow, create a bunhc of holes on a disk using classyblocks sounds so simple but :(
A smooth sea never made a skilled sailor
found it
b
clean
f
Ye, but the edge numbers are a bit funky
Copy code
one_core_disk = cb.WrappedDisk(sphere_center, corner_point, sphere_radius, [0, 0, 1])
for face in one_core_disk.faces[5:]:
    face.add_edge(3, cb.Origin((0, 0, 0), flatness=1))
but what do you now need
do you need more of these holes?
do you want expanding rings on it first let me do that, mmm that seems to be a bit more tricky as WrappedDisk is nto conformal to ExtrudedRing
and maybe instead of a grid like plcaement of holes, maybe it could be polar?
i want it to be paramteric?
f
AHHH heat exchanged you need
tubelar reactor
but then better
My sketch does not have those nice expanded rigns and then the block around it, for some reason I was not able to make those conformal @kandelabr probably knows how to do that.
I can probably program this
Let me make a cappucino and have a look
b
lemme have my cup of cofee as well befopre i delete openfaom lol
f
If I want to do polar becomes a tat more difficult I will keep it now in form of a grid
b
yeah that works too
ill have to see how to implement a polar one
f
mmm
that is a lot more difficult you have to move faces, I have done it, but with like a structural way not too easy, but definitely possible.
blockMesh needs some parallel running haha
TADA
b
wowza
f
just make an np array of the things you want and we good
b
thats perfect
f
I already did that
b
thank you thank you\
im really grateful
🙏 ☺️
would you be kind enought the share the code
f
Is this for a paper
b
oh might be i think
its fine in that case
thank you for the inspo
f
I have to still fix some things regarding the expansion
b
ill see what i can do with polar 🤑
ooooooo
b
oh
hmmm okay ill look into it as well 🫡
f
Let me put it up on github one sec
If you then add radial you can push it to the repo
as I might still work on it to make the outside of this also conformal to a cylinder as you want, so you can get some updates as I still work on it today probably
Did you now want this in a weird shape or not?
The outside?
b
okayy
okayyy got it
wdym weird shape?
f
I thought you wanted the outside in the shape of a wing
b
oh no lol
that was a different project idea
more so curiosity than project
cause i never saw a blockmeshdict for the insides of an airfoil
f
what are you doing now then?
ugh im trying to get a circle outer and then get a polar one setup
f
ow for thgat should not be too difficult I am doing that now with classy_blocks
Just a bit struggling on how I want the circles to be captured inside, and then select the outside wrapped disks and move their points to the circle and make them nicely arc https://cdn.discordapp.com/attachments/1446061956048883835/1452634516026949653/image.png?ex=694a86d1&is=69493551&hm=b6b7fe2580d5d33605771f4251e37eac71a8ace45cd199ecaeacbf5b4d010f9d&
f
ow no I will do it a bit nicer in the end I think, but you will not get thsoe holes close to the edge probably it will be possible but you will have to move the vertices with mesh optimizer
you can put all the points on it then select all outer edges then use the optimizer ill write that instead of moving the faces, not sure if that then also still keeps the curvature of those edges I will have to see
b
hmmmmmm
ill also do some caveman magic
and how is tu eindhoven? are you a doctoral student there?
f
I am doing my masters in electrification of chemical processes, and also got an offer for phd in that topic
so just a master student still
for 3 more months or so working on my thesis
b
wow thats nice to hear, congratulation and good luck on your thesis
f
I might do it I am not sure if I will
or the thesis, yeah nothing is converging haha but o well
btw using the optimization with curveClamps no work we need to move points, so I will do that instead
Copy code
py
mesh.assemble()

optimizer = cb.MeshOptimizer(mesh)

vertices = np.array([v.position for v in mesh.vertices])
sorted_indices = np.argsort(vertices[:, 2])
vertices_sorted = vertices[sorted_indices]

z_tol = 1e-12
bottom_vertices = vertices_sorted[vertices_sorted[:, 2] < z_tol]
top_vertices    = vertices_sorted[vertices_sorted[:, 2] >= z_tol]

radial_distances = np.linalg.norm(bottom_vertices[:, :2], axis=1)
max_radial = np.max(radial_distances)

outer_indices = np.where(radial_distances >= max_radial - 1e-12)[0]
outer_bottom = bottom_vertices[outer_indices]
outer_top = top_vertices[outer_indices]

circle_curve = cb.CircleCurve(sphere_outer_center, sphere_outer_rim, (0, 0, 1))

for bottom_v, top_v in zip(outer_bottom, outer_top):
    optimizer.add_link(cb.TranslationLink(bottom_v, top_v))
    optimizer.add_clamp(cb.CurveClamp(bottom_v, circle_curve))

optimizer.optimize(method="Nelder-Mead", tolerance=1e-5, max_iterations=1000) 
`
This no work
b
how is this coming along?
i think ill just create a simple polar stratergy and then work on putting it on a circle or somethign?
Just need a better way to select outside points in the sketch
if I would only done one quarter then I could select the edges because they are the same (top and right) and then copy rotate
MMMMMMMMMMMMMMM
sick
abstract art
b
very pretty
f
UIn other words, I do not want to select red while also selecting yellow, perhaps better to do this with vertices but I am not sure if I can make the curvature in that case https://cdn.discordapp.com/attachments/1446061956048883835/1452661172074577930/image.png?ex=694a9fa4&is=69494e24&hm=be0520e460ea38d3a31abe3f4d055fb84e0bdfc641ec1e2fa45b8b1389d50a6c&
ofcourse you can also just make the block big and then use SHM to make the circle around it
b
yeah that is also is an option
but i want it be perfectly structured so ill take a diff approach?
f
it is possible if you can select are points that are on the outside rim, for any object and then you can just easily move them with to_polar to_cartersian trick. But I have not found a simple way to do it. Because selecting on center distance does not work as some of the face points are also on the inside by the holes, while this distance is longer then the cartesian distances.
b
hmm
i think i might get an intial blockMesh from gridpro and try doing something with that in openfoam somehow and make it parametric?
viable idea?
f
you can also make this is ichem
https://lsec.cc.ac.cn/~lyuan/jcp.pdf @finn the svg meshes here go hard
f
decent
k
obviously I missed the party but you found my attempt at heat exchangers
I'll include it in the examples when I find some time but it's easy to make a grid - dirty jobs begin when one has to fill the voids at the boundary 😩
f
yes that is where I was stuck aswel and then quit
b
I got a nice mesh but getting it to be conformal with a bigger fluid domain is such a pain