CFD Online Discussion Forums

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

MarkW November 24, 2011 10: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 01: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 08:19

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


All times are GMT -4. The time now is 05:54.