CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   heat source in solid (http://www.cfd-online.com/Forums/openfoam/94757-heat-source-solid.html)

MarkW November 24, 2011 11:02

heat source in solid
 
Hello there,
I'm trying to simulate the heat transfer in a piece of metal, which is heated by an electric current.
I already got a little bit familiar with laplacianFoam, is there some way to model a heat source inside of it?
Or do I have to use a different solver?
Thanks a lot!

nimasam November 25, 2011 02:34

heat source in laplacianFoam
 
you can model heat source! just by add a source term to the laplacianFoam equation
in creatFields.H
Code:

    volScalarField q
    (
        IOobject
        (
            "q",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        ),
        mesh
    );

in laplacianFoam.C
Code:

fvm::ddt(T) - fvm::laplacian(DT, T) - q
then you should compile your solver with "wmake"! (look user guide)

then in your case study in folder zero you should add a file name "q"
you can apply different value from uniform or non-uniform heat source
for making the initial non uniform heat source use "setFields" or "funkySetFields"
for install "funkySetField", look at here:
http://openfoamwiki.net/index.php/Co...funkySetFields

MarkW November 25, 2011 09:19

Thanks a lot!
This approach saves me a lot of time! :)


All times are GMT -4. The time now is 20:42.