Can't converge a simple pipe elbow case

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

User avatar
NewJoker
Veteran
Posts: 3089
Joined: Sun Oct 11, 2020 7:49 pm

Can't converge a simple pipe elbow case

Post by NewJoker »

Hi,

after doing some experiments with external flow, I decided to test internal flow simulations as well. The first analysis (Venturi tube) was successful, at least when I switched to transient flow. However, the next model that I wanted to check (pipe elbow) can't converge at all. I've tried several tricks:
- transient instead of steady-state, various time incrementation settings
- different mesh size
- lower inlet velocity

but none of them helped. Maybe there's something wrong with the setup but I made it as simple as possible. It would be great if you could give me some suggestions. They will likely help me deal with more complex models in the future.

Here's the FreeCAD file with this model:
Pipe elbow.FCStd
(22.28 KiB) Downloaded 36 times

P.S. I still keep having that issue with zero results (https://forum.freecadweb.org/viewtopic.php?f=37&t=64740) but it disappears when I remesh the model. That's really strange.

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Polish/Poland (pl_PL)
thschrader
Veteran
Posts: 3158
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Can't converge a simple pipe elbow case

Post by thschrader »

You used Ux as inlet-vector, should be Uy.
Initialize with potentialFoam.
Start with low Uy (here: 50 mm/s)
Laminar, steady-state. See here:
Pipe_elbow_ts.FCStd
(22.32 KiB) Downloaded 41 times
BTW: using 16 cores is a little bit overkill... :shock:
inlet.JPG
inlet.JPG (61.71 KiB) Viewed 3218 times
User avatar
NewJoker
Veteran
Posts: 3089
Joined: Sun Oct 11, 2020 7:49 pm

Re: Can't converge a simple pipe elbow case

Post by NewJoker »

Thank you very much, it works now. I don’t know how I could have missed such a basic mistake. Maybe I should use the definition of velocity normal to the inlet face instead ;-)

Out of habit, I always set the number of cores for simulations to maximum available but in some cases it’s not necessary, right.
justwanttoknow
Posts: 27
Joined: Fri Oct 08, 2021 9:21 pm

Re: Can't converge a simple pipe elbow case

Post by justwanttoknow »

Quick thanks to both of you!
It has really helped to have a file, which is expected to run (of course meshing needs to be done.) to confirm a working installation.
Now further troubleshooting here...
KAKM
Posts: 112
Joined: Tue May 04, 2021 12:17 am

Re: Can't converge a simple pipe elbow case

Post by KAKM »

NewJoker wrote: Mon Dec 27, 2021 1:48 pm
P.S. I still keep having that issue with zero results (https://forum.freecadweb.org/viewtopic.php?f=37&t=64740) but it disappears when I remesh the model. That's really strange.
You might be meshing the wrong side of the surface you have marking the region boundaries. One of the inputs into snappyHexMesh/cfMesh is a point (XYZ coordinates) that tells the mesher which region is being meshed. It defaults to the origin, which is often not where you want it to be. Maybe it's getting changed when it shouldn't be/not changed when it should be? That point being wrong was the problem the last time I got a zero result field.
User avatar
NewJoker
Veteran
Posts: 3089
Joined: Sun Oct 11, 2020 7:49 pm

Re: Can't converge a simple pipe elbow case

Post by NewJoker »

KAKM wrote: Mon Dec 27, 2021 8:40 pm You might be meshing the wrong side of the surface you have marking the region boundaries. One of the inputs into snappyHexMesh/cfMesh is a point (XYZ coordinates) that tells the mesher which region is being meshed. It defaults to the origin, which is often not where you want it to be. Maybe it's getting changed when it shouldn't be/not changed when it should be? That point being wrong was the problem the last time I got a zero result field.
That's interesting. I've heard that OpenFOAM uses such a point to determine whether the mesh is for internal or external flow but I don't know how it's realized in CfdOF module. Meshing here requires only the selection of a volume (wind tunnel for external flow or pipe/channel for internal flow) and I assume that the rest happens automatically since the mesh is created for the correct volume. But maybe there are situations when it works unexpectedly. I guess that it's not possible to pick such a point in CfdOF, right ? Those errors that you've encountered happened in FreeCAD's implementation of OpenFOAM or in the standalone solver ?
KAKM
Posts: 112
Joined: Tue May 04, 2021 12:17 am

Re: Can't converge a simple pipe elbow case

Post by KAKM »

I was using CfdOF when that happened, and I did wind up fixing it by changing that point value. I wasn't actually able to get the mesher to run on a volume, I had to convert it to a shell.
NewJoker wrote: Mon Dec 27, 2021 8:48 pm I guess that it's not possible to pick such a point in CfdOF, right ?
It is, it's just that finding the spot in CfdOF where you can change it is a bit tricky. I think it's somewhere in the mesh creation dialog?

I can look for that for you, but my installation is somewhat broken at the moment because I've been trying to get Cfd and CfdOF to coexist on my computer and they like to interfere with each other, so I need to fix the meshing command enough to access that menu, which might take a bit.
justwanttoknow
Posts: 27
Joined: Fri Oct 08, 2021 9:21 pm

Re: Can't converge a simple pipe elbow case

Post by justwanttoknow »

Point can be specified during Meshing, of course only for snappyHexMesh
Attachments
Screenshot from 2021-12-27 22-45-19.png
Screenshot from 2021-12-27 22-45-19.png (24.88 KiB) Viewed 3033 times
User avatar
NewJoker
Veteran
Posts: 3089
Joined: Sun Oct 11, 2020 7:49 pm

Re: Can't converge a simple pipe elbow case

Post by NewJoker »

justwanttoknow wrote: Mon Dec 27, 2021 9:47 pm Point can be specified during Meshing, of course only for snappyHexMesh
So far I've only used cfMesh in my models. In that case, the location of this point shouldn't be a problem here, right ?
justwanttoknow
Posts: 27
Joined: Fri Oct 08, 2021 9:21 pm

Re: Can't converge a simple pipe elbow case

Post by justwanttoknow »

Correct, as far as I know.
Post Reply