chtmultiRegion case is not generating sets folder in postprocessing
1 Attachment(s)
Using the data in the sets folder, OpenFOAM creates streamlines. But while my case shows the postprocessing folder, it does not contain sets, so I can't generate streamlines. This is my preferred way to do it, as the ParaView streamlines don't work very well.
I have another case where everything works properly, but in this one, it does not, and I can't find the difference. Attached is the run log, and here is the controlDict file: Code:
FoamFile I don't know what to make of this. My other case with essentially the same controlDict has none of these errors. I hope that someone can spot my error and get me going again! |
Actually, the problem is related either to the loft, or the BCs, so the battle goes on.
|
1 Attachment(s)
Here is the new run log; if anyone can make sense of it please let me know!
It fails with this message: Code:
Energy -> temperature conversion failed to converge: Thanks, everyone! |
Interestingly, it ran to the end with a different set of BCs. Does this imply that the loft is okay? If so, I am again left at my wits end.
|
If anyone is inclined to help me out of my misery, I would be delighted to post my case on dropbox.
|
continuing problem with sets folder wrt streamlines
In the process of running a simpleFoam case to debug my chtmultiRegion case, I need to create streamlines to visualize flow. The native OpenFOAM streamline function works far better than the paraview version, so I always try to use it.
This requires a sets folder to be created under postProcessing. But in my current simulation, the sets folder is not being created, and for the life of me, I cannot understand why. I am using a previous successful case as a template, but when I run the new one, the sets folder is absent. Can someone tell me what it is that triggers the creation of the sets folder? |
more info on streamline problem
Just to follow up, in the problematic case, this appears in the run log:
Code:
streamLine streamLines write: Code:
treamLine streamLines write: |
problem solved! But now I have a new one: no postProcessing folder is created
My problem was that there was no 'sets' folder under the 'postProcessing' folder, when I was trying to implement streamlines. Finally, I found this procedure:
Enter 'foamGet streamlines' at the command prompt in the run folder. Then it asks it you want option (1) or (2). I selected (1). This created a file 'streamlines' in the system directory. Note that the streamline function also uses a file 'streamLines' in the same directory. Previously, I had always used the latter file, but found that I could edit the 'streamlines' file, and the upshot was that the desired 'sets' folder was now created! It is an oddity that both 'streamlines' and 'streamLines' can be used, but this is indicative of the committee nature of the OpenFoam programming culture. New problem: this was all in relation to a simpleFoam case that I was using to debug my multiregionFoam case. So, after getting it to work, I transported the appropriate files to my multiregion case. Now, I find that when running it, no postProcessing folder is created at all! I'm still searching for the cause, but if anyone has guidance, I would be grateful! |
Hello Alan,
When using function objects on a multiregion case, you should define in which region the function should be applied, using the "region" parameter in the function definition. E.g.: Code:
region fluid; Quote:
Code:
type streamLine; The name of the files itself does not matter, it could be streamLines, streamline.cfg, streamlines.whatever, foobar, it would still work as long as the files contains the proper code snippets and are properly included where it is required. These predefined files are just a trick to avoid having to define the function by yourself but you can also totally avoid using these files, and define the function yourself in the controlDict file (or in whatever file you will then include in the controlDict) Regards, Yann |
Can't find the magic key to get the case to work!
Hi Yann,
Thanks for the reply! Still it doesn't work. There is inconsistency between some of the cases you have helped me with. First, I have a simple template case, which is chtMultiRegionFoam simulation run in parallel, which you may still have. It works great, and here is the applicable part of the run parallel script: Code:
mpirun -np 8 chtMultiRegionFoam -parallel | tee run.log Now regarding my current chtMultiRegion case, I first ran it as a simpleFoam case without the heat exchanger. I was struggling with streamlines, and finally got it to work. Here is the controlDict: Code:
functions btw, the streamlines.cfg file reads as: Code:
type streamLine; Then, I took the simpleFoam case and adapted it to be a chtMultiRegion case. It is set up as a serial run, and only works if the run script contains: Code:
chtMultiRegionFoam | tee run.log If I edit the run script as follows: Code:
chtMultiRegionFoam -postProcess -region fluid | tee run.log If you have a slot in your busy schedule to have a look, the case can be found here: https://www.dropbox.com/scl/fi/09w9b...950pnwdv6&dl=0 |
Hello Alan,
I feel like you are getting confused by the function objects and the different ways to use it. Let's untangle your setup. Here is the first line of the functions section in your controlDict: Code:
#include "streamLines" In your system directory, there is a streamlines rather than a streamLines file. This should not work, my best guess is that you are using WSL and since Windows is not case sensitive it does not make a difference between streamLines and streamlines. Alright so if you remove all the functions from your controlDict except the #include "streamLines" bit, you will notice the solver is not happy with it as it throws a bunch of errors: Code:
PIMPLE: Region fluid Code:
/*--------------------------------*- C++ -*----------------------------------*\ You can have a look at this file using this command for instance: Code:
nano FOAM_ETC/caseDicts/postProcessing/visualization/streamlines.cfg Code:
Alan_function Code:
Region: fluid Courant Number mean: 90.0808 max: 1.33005e+06 Code:
This is why you had some functions working with simpleFoam but not chtMultiRegionFoam: the region parameter was not defined, and it is obviously only required on multi region cases. The #includeEtc, or #includeFunc directives are meant to be a handy way to get default functions settings, which you are supposed to adjust to your case if needed. You can have a look in the section 6.2.2 of the user guide for more details: https://doc.cfd.direct/openfoam/user...processing-cli I hope this made things a bit clearer. Yann |
Made some progress, but there is still a streamlines problem
2 Attachment(s)
Hi Yann,
Finally I managed to get the streamlines working, although this was with the system folder containing a stream*l*ine file, rather than stream*L*ine. If I used the latter, no sets folder was created. I followed your advice, editing the files to add the fluid region to my multiregion case, including cuttingPlane, forceCoeffs and streamline. Here is the text for controlDict: Code:
application chtMultiRegionFoam; Code:
forceCoeffs1 Code:
#includeEtc "caseDicts/postProcessing/visualization/streamlines.cfg" Code:
Create time do not flow properly around the body. However for the simpleFoam case they look great. See the attached image. For the multiregion case, on the outside of the duct, they just flow to the surface and stop, rather than flowing around. On the inside, they do not diverge to follow the expanding duct, but just stay towards the bottom. This is inconsistent with the paraview image of the U field. In this, the maximum velocity is in the middle of the radiator, but the streamlines don't flow there at all. Also included is the image for the p field, which seems reasonable. This is with the darcy-forchheimer coeffcients set at d(20 20 20) and f(20 20 20) which is a very low flow restriction. Using the same CAD geometry, I have used two different meshing packages to create the mesh, but the results have been the same, which indicates that the problem is inherent to my case setup. What in the world am I doing wrong? |
Hello Alan,
Are you using the same boundary conditions on both simpleFoam and chtMultiRegionFoam? As far as I remember, you set a velocity value on the wall on your CHT case, which does not really make sense (it should be either slip, noSlip, or fixedValue uniform (0 0 0)). This could explain why the streamlines stop at the wall. Regards, Yann |
OMG! It worked! But failed at time step 5 - almost there!
Hi Yann,
You were right about the U boundary condition; what I had was stupid and I am a bit embarrassed. But when I fixed the U bc's, the case failed at time step 6, so I changed it to stop at 5, and the streamlines look awesome! There is still an issue with the bc's, so I am showing them to see if you can save me again, as if you haven't done it enough already (this in lieu of my normal practice of wildly changing values): fluid p: Code:
dimensions [1 -1 -2 0 0 0 0]; fluid p_rgh: Code:
dimensions [1 -1 -2 0 0 0 0]; fluid T: Code:
dimensions [0 0 0 1 0 0 0]; fluid U: Code:
dimensions [0 1 -1 0 0 0 0]; solid p: Code:
dimensions [1 -1 -2 0 0 0 0]; solid p_rgh: Code:
dimensions [1 -1 -2 0 0 0 0]; solid T: Code:
dimensions [0 0 0 1 0 0 0]; solid U: Code:
dimensions [0 1 -1 0 0 0 0]; |
failure message
I should have mentioned, it fails with the "Energy -> temperature conversion failed to converge:" message.
|
All times are GMT -4. The time now is 13:45. |