Gebhardt factors CGS solver fails for emissivity of 1.00

Numerical methods and mathematical models of Elmer
adamo
Posts: 19
Joined: 02 Feb 2017, 00:19
Antispam: Yes

Gebhardt factors CGS solver fails for emissivity of 1.00

Post by adamo »

Dear Elmer Community,

I am working on a conductive-radiative heat transfer simulation in a rather large geometry, which means I have to use an iterative solver to calculate the Gebhardt factors from view factors. My casefile is attached, the UNV file with the mesh cannot be uploaded due to size but I would be happy to send it to you if you need.

All the simulation runs fine with the casefile I am sharing, as long as the emissivity is not equal to 1.00 (and yes, it this specific geometry, it helps to set it to 0.99 but in more complex geometries, I am getting the same error at emissivity of 0.9, which is already a trouble). Thing is, that with emissivity very close to 1.00, the CGS iterative solver fails, saying

Code: Select all

IterSolver: Using iterative method: cgs
       1 0.0000E+00
IterSolver: Using iterative method: cgs
       1 0.2122-312
ERROR:: IterSolve: Failed convergence tolerances.
Note: The following floating-point exceptions are signalling: IEEE_DENORMAL
Now this seems that the solver residua are too small and the CGS solver can not handle it. With the same emissivity of 1.00, the direct UMFpack solver and the full Gebhard solver manage to calculate the Gebhardt factors. But as I said, I have quite a lot of radiating surfaces and can not use either of these solvers in the geometries relevant to my experiment.

Trying to dig in the answers from the source codes, I found the FIterSolve routine in the GebhardtFactors.F90 . It seems to have CGS hard-wired as the iterative solver for the iterative Gebhardt factor calculation. My question is, if there is a point in trying to update the GebhardFactors.F90 file so that it uses another solver. My feeling is, that with emissivity of 1.00, the CGS residua are already too small in the first iteration and that is why it fails. Is there a way to get around it?

Many thanks

Adam
Attachments
radiation.sif
(2.15 KiB) Downloaded 318 times
adamo
Posts: 19
Joined: 02 Feb 2017, 00:19
Antispam: Yes

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by adamo »

So, answering to myself (and, hopefully, also future generations using Elmer for radiation problems :-) ): You can easily get around this issue by replacing the default UMFPACK solver with MUMPS (as long as you have it). All you need to do open the RadiationFactors.F90 file and replace around the line 1112 this text:

Code: Select all

!CALL ListAddString( Solver % Values, &
  'Linear System Direct Method', 'Umfpack' )
with

Code: Select all

CALL ListAddString( Solver % Values, &
  'Linear System Direct Method', 'MUMPS' )
Then you re-compile Elmer and use MUMPS direct solver for Gebhards factors ... et voila! I got about 10x speed-up as opposed to the CGS solver for my test case and am planning to test it out with complex geometry.

Adam
Z.Losonc
Posts: 40
Joined: 21 Dec 2017, 16:05
Antispam: Yes

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by Z.Losonc »

Hi Adamo,

Thanks for sharing the hack.

I am not using this solver at the moment, but interested in this technique that you used to fix the problem.
There are similar problems in FluxSolver as well, which could be perhaps fixed in a similar way as you did here.

Did you compile the source code on Windows or on Linux?

Regards,
Zoltan
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by mzenker »

Hi,

question to Elmer team: As far as I see, the radiationfactors routine is just used in HeatSolve. Why is it part of the ElmerSolver core instead of using it as separate solver or integrating it into HeatSolve? In that case, simply recompiling the corresponding solver with Elmerf90 would do the trick. And it would correspond to the concept to do the physics in the solvers (as far as I understand it).
Just curious...

Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by raback »

Hi,

Adamo, the code could be more flexible here. Perhaps you could share your test case to fix the problem, and we could add a new keyword for setting the linear system method.

Matthias, actually the RadiationFactors used to be a separate module (called GebhartFactors) and the factors were read from file when running ElmerSolver. However, this had a limitation that emissivity could not be a function of temperature, which it often is. Hence the code was made part of ElmerSolver. It could be dynamic but it takes some effort to add APIs for the elmerf90 routines. And the added flexibility is needed, like in this case, once in a few years...

The ViewFactors (purely geometric entities) is still a separate binary that is called with a system command if the view factors are not present.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by mzenker »

Thank you for the explanation!

Matthias
adamo
Posts: 19
Joined: 02 Feb 2017, 00:19
Antispam: Yes

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by adamo »

@Z.Losonc , I am not sure what you mean about FluxSolver. As far as I know, you can set the solver in the .sif file and by briefly checking the FluxSolver.F90, I would say that Elmer would consider it.

Peter @raback, I am attaching my test case
simple3d_radiation_test.zip
(181.01 KiB) Downloaded 311 times
. You will find there:
the case file radiation.sif
the mesh file in UNV simple3dmesh.unv
The mesh is a heated cube inside a hollow sphere with air in between the cube and the cylinder. The air conducts heat but a more important heat transfer channel is the radiation between the sphere and the cube. The mesh is very coarse (for testing purposes because Gebhardt Factors calculation always runs on a single core) so the solution does not look very nice but proves the point that the hollow sphere is remotely heated by the cube.

Now this solution does not converge if you solve it by default Elmer (I tested both 8.2 and 8.3) because the CGS solver during Gebhardt Factors Calculation fails. For this reason, I made a slight modification to the RadiationFactors.F90 file (also attached, look around line 1111). It seems that Elmer creates a new Solver object for the Gebhardt factors and adds some default properties to it, one of which is the CGS solver as the default iterative solver. It turned out to be the best to use GCR as the iterative solver for Gebhardt Factor calculation and MUMPS as the direct solver. GCR seems to be the only solver which does not fail at emmissivity close to 1.0. On the other hand, if you have lower emissivities and large reflectivity, you might find BiCGStab a better choice.

It seems that it could be quite easy to place these parameters to the case file (Something like Gebhard Factor Iterative Method = GCR). Hope someone will find this useful one day :-)
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by raback »

Hi

Thanx! This was useful.

At some stage the IterSolver had started to treat almost zero residuals of hutiter library as errors. This is now fixed. Actually the ViewFactors and GebhartFactors are exactly the same in case emissivity is always one.

Also the solver that is used for Gebhardt factors now inherits any given linear system keyword that has prefix "radiation:" from the primary solver. For example,

Code: Select all

  radiation: Linear System Solver = iterative
  radiation: Linear System Iterative Method = "bicgstab2" 
So this should allow arbitrary linear solver strategies to be used.

The changes are since a few minutes in "devel" branch at GitHub.

-Peter
Z.Losonc
Posts: 40
Joined: 21 Dec 2017, 16:05
Antispam: Yes

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by Z.Losonc »

Hi Adam,

The FluxSolver has been briefly described in ElmerModelsManual.pdf Model 42: Flux Computation, and it is used universally in different physics to calculate additional variable fields that are not computed by the main solver (like the acoustic velocity).

The problem with this solver has been described in this viewtopic.php?f=3&t=4916 thread.

In a few words: it works with a direct solver for small meshes (which will demand too large memory with large meshes). It does not work with CG iterative method, which was suggested and used in the example 42.5 at the end of the FluxSolver chapter (even the post-processors freeze if one tries to open the results file computed by CG).

The BiCGStab method produces results that look realistic, but the solver gives warnings in the Log like: “NUMERICAL WARNING:: IterSolve: Failed convergence tolerances.” Interestingly though, the last iteration gives this residual: 0.3180E-38, which is a very similar situation that you have experienced when you wrote “the solver residua are too small and the CGS solver can not handle it.”

Unfortunately the developers did not consider this subject to be worth even addressing so far.

But there are some more problems with the acoustic Helmholtz solver, like not having a perfectly matched layer (which is essential). So if we are serious about getting Elmer acoustics with Helmholtz solver to be useful for general simulations, additional code will have to be added, which means, we have to know how to compile the source code without errors.

The reason I was asking you about your OS and your method of compilation is that I have attempted to compile the source code on Linux Mint 17, but it did not work the way it was described on the official Elmerfem web pages, see the thread here viewtopic.php?f=2&t=4922

I am looking for clear, and detailed compiling instructions that work on Linux (now using Linux Mint 17.3). Nobody seems to be interested in enabling us to do this either…

Zoltan
Last edited by Z.Losonc on 05 Feb 2018, 20:32, edited 1 time in total.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Gebhardt factors CGS solver fails for emissivity of 1.00

Post by raback »

Hi Zoltan

The issue with almost zero residual and NumericalError has been fixed. Developers are unfortunately occupied most of the time with the current projects. We do appreciate the active users but time is just a limited resource...

-Peter
Post Reply