|
[Sponsors] |
Writing a solver - heat equation - Solution diverges |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 30, 2013, 01:28 |
Writing a solver - heat equation - Solution diverges
|
#1 |
New Member
Dheepan Iyyampillai
Join Date: Jan 2013
Location: Bangalore, India
Posts: 3
Rep Power: 13 |
Hi,
I'm new to CFD and OpenFOAM. I was able to write a solver for 1-D heat equation with and without source and run it easily. The numerical solution matched with analytical solution. But when Convection is included in the code, it diverges, and temperature becomes infinity. Code:
\*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createFields.H" simpleControl simple(mesh); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating temperature distribution\n" << endl; while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; while (simple.correctNonOrthogonal()) { solve //Solves thermal diffusion in a solid with convective heat transfer along its length ( fvm::laplacian(T) - n* (T-Tatm) //where n = hP/kA ); } #include "write.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************************************* // |
|
Tags |
diverged, heat equation, laplace, programming, solver |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solver for an incompressible, turbulent flow with heat transfer | tH3f0rC3 | OpenFOAM Running, Solving & CFD | 9 | June 17, 2019 07:12 |
Neumann Boundary Condition for Poisson Equation solution in Polar Coordinates | prapanj | Main CFD Forum | 2 | July 30, 2011 20:07 |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 09:56 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
heat equation solution source code | john | Main CFD Forum | 1 | May 28, 2004 00:41 |