CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

cannot get chtMultiRegion case to work

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2022, 13:46
Default cannot get chtMultiRegion case to work
  #1
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
Hi community,


My interest in CFD is as a vehicle designer; to do my work I need 2 tools: simpleFoam to calculate lift and drag, and chtMultiRegionFoam to analyze heat exchanger integration. Regarding the first tool, I have a good handle on it - for the second, not so much.


Since November (!) I have been struggling with chtMultiRegionFoam as applied to a porous zone heat exchanger in a lofted body case, and have received a lot of advice, suggestions and actual time-spent-aid from generous people on this forum. I have gone through the tutorials, and carried over applicable material. Still no luck.
The big problem is failure accompanied by the "...exceeded maximum number of iterations..." message. It occurs immediately at time step 2. This could be a BC problem, or something more fundamental. I hate to ask yet again for help, but if anyone has time on their hands, my case can be found in this dropbox link:


https://www.dropbox.com/sh/fdbqckqdb...tC0oXhYMa?dl=0


As a sanity check to see if the mesh was at fault, I removed the heat exchanger and ran the case as a just a body with an empty duct, and it ran successfully. For reference, this case can be found in this dropbox link:


https://www.dropbox.com/sh/ukpv6cl3m...j7Thd3RPa?dl=0


All this notwithstanding, I will keep trying to make my case run, and will always be grateful for the help I have received.


boffin5
boffin5 is offline   Reply With Quote

Old   May 3, 2022, 14:17
Default some clues for chtMultiRegion detectives
  #2
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
Today's attempt at resolving the mystery consisted of removing the body (fuselage), and running the case with the just the heat exchanger (porous zone) alone. And it ran!

And, the converse, running the body alone without the heat exchanger, also successfully ran.

Images of these situations are attached.

But, when I run them together, the chtMultiRegionFoam case fails. I checked, and the location of the radiator in the duct is precise; there are no heat exchanger cells pushing into a non-meshed area.

So what to make of this?

I am now wondering if my computer itself is to blame. It is an old laptop, whose processor has 2 cores. As I speak, I have a pile of parts waiting to coalesce into a relatively powerful desktop computer, that I configured for CFD. Computer to blame or not, I might as well proceed!
boffin5 is offline   Reply With Quote

Old   May 5, 2022, 02:49
Default
  #3
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 354
Rep Power: 12
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
It seems you are struggling for some days.
Have you uploaded your solver in GitHub or GitLab? If then, share the link.

Let me look into it.
Thank you
Kummi is offline   Reply With Quote

Old   May 6, 2022, 01:01
Default Thank You, Kummi!!
  #4
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
Not just struggling for some days, but rather, months!


It would mean the world to me if you could help me sort out this case.
Regarding Github, I created an account, and went through the steps to upload my files. Then I tried to implement Github desktop, but it repeatedly failed on my Mac.

(btw, all my OpenFOAM work is done on a windows machine, but I transfer the files to my Mac for dissemination)

So for my Github account, the link is here:

https://github.com/boffin5/chtMultiRegion-rv6


But I am not sure if my files actually were uploaded.
However, if this didn't work, the files should be available in a Dropbox site as indicted in my previous post.


I am looking forward to your help, and if there is anything I need to do, by all means, please let me know.


Regards,
Alan w
boffin5 is offline   Reply With Quote

Old   May 6, 2022, 02:18
Default
  #5
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 354
Rep Power: 12
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Alan,
Let's forget what we discussed in the past. Starting fresh !!
I have looked your case files in GITHUB. Irrespective of errors you are facing, I have some queries to ask you.
In regionProperties,
Quote:
regions
(
fluid (fluid solid)
solid ()
);
Why did you declared solid zone inside fluid zone ?

Anywhere in OpenFOAM, under constant/solid/thermophysicalProperties, the thermoType for solid is heSolidThermo, not heRhoThermo
Quote:
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport polynomial;
thermo hPolynomial;
equationOfState icoPolynomial;
specie specie;
energy sensibleEnthalpy;
}
Check the links:

https://github.com/OpenFOAM/OpenFOAM...icalProperties
https://github.com/OpenFOAM/OpenFOAM...icalProperties
So somewhere the basic understanding about the problem is lagging. The flow physics might look easy, but implementation in OpenFOAM requires some understanding.

Some homeworks to do:
1) What's your base solver ? I mean from which solver you built your customized solver ? Can you justify your choice about base solver and any references based on it.
2) Have you come across any references/journals related to your application in OpenFOAM ?
3) Create doxygen documentation. It's a good reference manual with source trees to easily understand the actual code.
4) If Steps 1 - 3 are clear, you need to copy necessary files/folders from OpenFOAM for your customized solver and resolve step by step. Use Debugger like gdb, nemiver to track your code and catch the flow. That's key !!

Honestly, it looks completely vague for now. More discussions will shape this work in a better way.
Thank you
Kummi is offline   Reply With Quote

Old   May 6, 2022, 04:17
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,191
Rep Power: 27
Yann will become famous soon enough
Hi to both of you,

If I may interfere in the talk...

@Kumaresh: Alan doesn't use a customized solver, he uses the original chtMuliRegionFoam solver. His case is based on the heatExchanger tutorial (https://github.com/OpenFOAM/OpenFOAM.../heatExchanger) where 2 fluid regions are coupled together through the constantHeatTransfer source in fvOptions. It's a bit different from the usual chtMultiRegion cases.

@Alan: have you tried changing the mesh refinement in the radiator vicinity? I did not have time to check your case but I remember something similar happened in your simplified case. Or is it my memory failing me?

Regards,
Yann
Yann is offline   Reply With Quote

Old   May 6, 2022, 04:39
Default
  #7
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 354
Rep Power: 12
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Yann,
Glad you interfered, Happy to interact.
Quote:
@Kumaresh: Alan doesn't use a customized solver, he uses the original chtMuliRegionFoam solver. His case is based on the heatExchanger tutorial (https://github.com/OpenFOAM/OpenFOAM.../heatExchanger) where 2 fluid regions are coupled together through the constantHeatTransfer source in fvOptions. It's a bit different from the usual chtMultiRegion cases.
That's cool. I'm not aware of it. May be the name 'solid' region in his case file confused here. But in previous thread, Alan posted that the case has porous solid zone. Link below. It's better to follow strict convention names for solid and fluid regions appropriately.
Hoping for help with boundary conditions in chtMultiRegion case
Thank you
Kummi is offline   Reply With Quote

Old   May 6, 2022, 12:44
Default Thanks Kummi and Yann!
  #8
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
To set the stage, I'm a design engineer, specifically in air vehicle preliminary design (hence my interest in CFD). Skill level in computer programming: just enough to use the tools needed to do design work.


Attached is a Powerpoint file showing the basic setup of my case. In my current case, the physical geometry in the fluid region body is much more complex than the shown in the schematic, although for the solid (porous zone) region, it remains a cuboid. Some of the boundary conditions in the chart have been overtaken by the ones in the GitHub posting.


I have a simplified case, similar to the Powerpoint one, which ran successfully. But in the complex case in question, it only runs when either the body in the fluid zone, or the solid zone radiator, are deleted. But it fails when both are present.


Yann, yes I have tried to increase the mesh fineness for the radiator, to no effect. Today I will increase the mesh fineness in the body adjacent to the radiator. Fingers crossed, to complete this madness. But since the case fails immediately, I am wondering.


Kummi, in answer to questions 1 -3:
1 - Yann answered
2 - There are examples extant using a shell and tube heat exchanger. But for a real radiator, the complexity of the geometry would be out of scope. So I am approximating real radiator details via the use of a porous zone. The idea is that once I have a running case, I can tweak the parameters to yield the performance characteristics of a real radiator. In short, I have not found any cases in the technical world, which take this approach.
3 - For debugging, my skills only suffices for me to create various iterations, from which I try to draw clues.


In any event, my thanks go out to you both! I am lucky to have this forum, and moreover generous people like yourselves in it.
Attached Files
File Type: pptx radiator-case.pptx (72.8 KB, 6 views)
boffin5 is offline   Reply With Quote

Old   May 6, 2022, 15:07
Default
  #9
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
Yann, I forgot that I had already made the fuselage mesh finer in the area of the radiator. In fact, I have 6 different refinement zones for the fluid region/fuselage that I made with curves and/or volumes, used to make the mesh finer in key areas.


However, meshing could still be the problem. At this point, I have nearly run out of things to try, given my lack of debugging skills.
boffin5 is offline   Reply With Quote

Old   May 13, 2022, 15:33
Default thought I found the problem - but alas, not so
  #10
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
After looking through articles on porous zone heat exchangers, I found one that showed a cylindrical duct with a square porous zone that extended well beyond the cylinder walls. Aha!!, I aha'd. My case had a radiator with a net, line to line fit in the duct. All I had to do was extend the radiator so that it extended past the duct, into the unmeshed part of the domain. See attached image.


But when I attempted to run it, once again the same failure, 'exceeded maximum number of iterations,' came staring back at me. Note that the case runs okay with just the fluid region, with its fuselage and duct, and also runs okay with just the radiator. But when they are both present, utter failure.


Furthermore, a template case of mine, having the same setup, but with a greatly simplified body in the fluid region, also runs successfully. This makes no sense.


I am hoping for guidance on how I can finally conquer this problem.


Also attached is a complete run log of the latest failure.
Attached Images
File Type: jpg SnapCrab_NoName_2022-5-13_11-11-3_No-00.jpg (89.9 KB, 8 views)
Attached Files
File Type: txt runlog(5).txt (29.1 KB, 1 views)
boffin5 is offline   Reply With Quote

Old   May 15, 2022, 15:53
Default The cause of the chtMultiRegion problem was symmetry! - but how to fix?
  #11
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
FINALLY!! Not total success, but I was able to make my case run. I did this by removing all of the 'symmetry' provisions, and just running the case as half of a fuselage flying through the air.


So it seems that way I implemented symmetry is problematic. I could just give up on it and include both sides of the geometry, but obviously that would be expensive in time and computing resources, so I need to understand what I did wrong. Here is one of the '0' BC files as an example; it shows the symmetry provision commented out.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.375;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"
    
    "rightSide|leftSide|upperWall|ground"
    {
        //type            zeroGradient;
        type            slip;
    }
    
     /*"rightSide"
    {
        type            symmetry;
    }*/

    
    inlet
    {
        type            fixedValue;
        value           $internalField;
    }
    
    outlet
    {
        type            zeroGradient;
    }
    
    bod
    {
        type            kqRWallFunction;
        value           $internalField;
    }
   
    fluid_to_solid
    {
        //type            zeroGradient;
        type            kqRWallFunction;
        value           $internalField;
    }

    
}


// ************************************************************************* //
In the 'symmetry' version that failed, there was a blockMeshDict in system/fluid and system/solid. In both, I had the 'rightSide' face as 'symmetry'. In the version without symmetry that ran, I changed it to 'patch.'



Also, in the runlog, there was this warning:
Code:
Solving for fluid region solid
--> FOAM Warning : 
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source solidTofluid defined for field h but never used
--> FOAM Warning : 
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source solidTofluid defined for field h but never used
What is causing that? The complete runlog is attached. Also, here is a Dropbox link to the folder of the complete case:


https://www.dropbox.com/sh/z9absepcn...SmPW0Mz7a?dl=0


If I can get help with my symmetry issue, and the above FOAM warning, I can get this bearcat solved! - and go on with my life.
Attached Files
File Type: txt runlog2(1).txt (25.2 KB, 1 views)
boffin5 is offline   Reply With Quote

Old   May 16, 2022, 16:28
Default
  #12
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 278
Rep Power: 6
boffin5 is on a distinguished road
Found the fix for the "source ..... never used" FOAM warning, but still working on the symmetry problem. The drivaer simulation has 'symmetry' in the boundary conditions, but for the symmetry plane in blockMeshDict, calls it out as 'wall'. I'll give that a shot.
boffin5 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MapFields doesnt work in the "counterFlowFlame2D" tutorial case panachristos OpenFOAM Running, Solving & CFD 9 August 26, 2018 22:27
implementation of mapFields into parallel transient case simpomann OpenFOAM Pre-Processing 4 August 2, 2016 05:41
CFD Post - How to check for case in an expression pilakin ANSYS 0 September 26, 2014 05:44
Case (VOF + Solidification&Melting) will not work with Species Transport? ERROR ? andy.eco FLUENT 4 September 14, 2010 18:27
Changing the grid on the same set-up Katya FLUENT 7 October 8, 2009 17:31


All times are GMT -4. The time now is 08:46.