CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

conjugateHeatFoam: Problems adding 3rd region

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 7, 2010, 09:48
Default conjugateHeatFoam: Problems adding 3rd region
  #1
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
Has anybody tried to modify the conjugateHeatFoam solver for 3 regions? My case will compile but at runtime I get a "floating point" error as soon as I try to add my third equation to the solver.

For testing purposes my problem is very basic, just a simple laplacian in 1D and I can solve this using the conjugateHeatFoam solver with 2 regions but I can't split this up into 3 regions.

The part of my code that doesn't seem to be working is when I add the third region:

Code:
        coupledFvScalarMatrix C1Eqns(3);

        // Add left equation
        C1Eqns.set
        (
            0,
            new fvScalarMatrix
            (
                fvm::laplacian(D1Left, c1Left)
            )
        );

        // Add middle equation
        C1Eqns.set
        (
            1,
            new fvScalarMatrix
            (
                fvm::laplacian(D1Middle, c1Middle)
            )
        );

        // Add right equation
        Info << "Check: Before third equation\n" << endl;
        C1Eqns.set
        (
            2,
            new fvScalarMatrix
            (
                fvm::laplacian(D1Right, c1Right)
            )
        );
        Info << "Check: After third equation\n" << endl;

        C1Eqns.solve();
This is the output that I get:

Code:
Create mesh for time = 0

Reading field c1 (left)

Reading field D1 (left)

Reading field c1 (middle)

Reading field D1 (middle)

Reading field c1 (right)

Reading field D1 (right)


Starting time loop

Check: Before third equation

Floating exception
So this implies that the solver is crashing when trying to add the third equation to the coupled matrix.
benk is offline   Reply With Quote

Old   April 7, 2010, 10:59
Default
  #2
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
I was able to fix this. It was a problem with my mesh.
benk is offline   Reply With Quote

Old   April 21, 2010, 05:57
Default
  #3
Member
 
David
Join Date: Dec 2009
Location: Spain
Posts: 58
Rep Power: 7
David_010 is on a distinguished road
Hi Benk

What solver is that? I´m working with OpenFOAM-1.6 and I don´t have it. The only solver for conjugate heat transfer I have is chtMultiRegionFoam.
And, is it valid to work with liquids?

Thankyou very much

David
David_010 is offline   Reply With Quote

Old   April 21, 2010, 07:59
Default
  #4
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
It's called the conjugateHeatFoam solver which is only in the -dev releases (I'm using 1.5-dev). Technologically, I think it's better than chtMultiRegionFoam since it puts all coupled equations into a single matrix (therefore 1 matrix inversion instead of, say, 3). It's also a bit easier to setup than chtMultiRegionFoam.

More info on it can be found here: Integrated conjugate heat transfer solver in OpenFOAM

As far as it being able to handle liquids, you just have to add the appropriate PDEs.
benk is offline   Reply With Quote

Old   April 21, 2010, 12:24
Default
  #5
Member
 
David
Join Date: Dec 2009
Location: Spain
Posts: 58
Rep Power: 7
David_010 is on a distinguished road
Hi Benk

Thankyou very much for your answer. Sorry but I don´t have any knowledge of OpenFOAM programming. Is possible to run that solver in the 1.6 versión, or I have to install de -dev version? And when you say "add de PDEs" you mean that I have to rewrite the solver?

Thankyou very much again

David
David_010 is offline   Reply With Quote

Old   April 21, 2010, 12:46
Default
  #6
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
Quote:
Is possible to run that solver in the 1.6 versión, or I have to install de -dev version?
Unfortunately, to use it you have to install 1.5-dev.

Quote:
And when you say "add de PDEs" you mean that I have to rewrite the solver?
I suppose, yes. You'd just have to modify the base conjuagteHeatFoam solver with whatever PDEs you want to solve.

As an asside, this is where I wish OpenFoam would be a bit more clear. I'm using the conjugateHeatFoam "solver" for things that are totally unrelated to heat transport, so why is it that the application mode and the solver have the same name? This solver should really be called something like "multi region coupled matrix solver" and the application that it was orginally intended for was conjugateHeatFoam. But only in very rare cases will there be a model that fits exactly your needs without you having to modify the equations.
benk is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
How to add 3rd region to chtMultiRegionFoam benk OpenFOAM 1 April 3, 2010 17:22
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19


All times are GMT -4. The time now is 22:28.