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

Heat source in a particular region inside the fluid domain

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   September 2, 2010, 02:31
Default Heat source in a particular region inside the fluid domain
  #1
Member
 
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16
robingilbert is on a distinguished road
Hi i want to add a heat source inside a small region in a fluid domain. i added a heat source term in TEqn.H and it works fine for the whole region. But i want to impose a condition that the heat source gets activated inside a small control volume. i have been reading up a lot but cant figure out how to go about doing it. if atleast someone can tell me where to start, I will figure it out. how do i give an if-else condition to check if it is solving the domain i need to add the source term.

i tried the following in the createFields.H

Code:
volScalarField x = mesh.C().component(vector::X);
volScalarField y = mesh.C().component(vector::Y);
volScalarField z = mesh.C().component(vector::Z);

forAll(x,celli)
{
    if(x[celli] >= 1 && y[celli] >= 1 && z[celli] >= 2.2 && x[celli] <= 1.5 && y[celli] <= 1.5 && z[celli] <= 2.5)
    {
       dimensionedScalar Q
    (
    "Q",
    dimensionSet(1,-1,-3,0,0,0,0),
    scalar(5000)
    );
    }else
    {
       dimensionedScalar Q
    (
    "Q",
    dimensionSet(1,-1,-3,0,0,0,0),
    scalar(1000)
    );
    }
}
unfortunately the Q value is not set by this method.

Thanks.
robingilbert is offline   Reply With Quote

 

Tags
heat source, if-else


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulation of a single bubble with a VOF-method Suzzn CFX 21 January 29, 2018 00:58
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
How can I increase Heat Transfer at Domain Interf? B.Simon CFX 3 October 28, 2008 18:53
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


All times are GMT -4. The time now is 06:01.