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

Fixed Temperature Cell in Solution

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

Like Tree3Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   April 30, 2011, 16:15
Default
  #21
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Jeff,

add this snippet to an appropriate place in your code, for example in createFields.H:
Code:
    label TRefCell = 0;
    scalar TRefValue = 0.0;
    setRefCell(T, mesh.solutionDict().subDict("PISO"), TRefCell, TRefValue);
And in your fvSolution:
Code:
PISO
{
    . . .
    //TRefCell	0; // <--- definition via cell label
    TRefPoint       (0 0 0); // <--- definition via coordinates
    TRefValue      1000;
    . . .
}
Martin
MartinB is offline   Reply With Quote

Old   May 30, 2011, 19:30
Default
  #22
Senior Member
 
jeff osborne
Join Date: Mar 2010
Posts: 108
Rep Power: 7
ozzythewise is on a distinguished road
Update to this old thread:

Upon playing with this it didn't do it quite as i wanted. I'm not sure what it was doing but it wasn't keeping my temperature at 1 value, it was changing in time. So what I did is made my TEqn.H file read as follows:

Code:
/**************************
solve
(
    fvm::ddt(T)
    + fvm::div(phi, T)
    - fvm::laplacian(DT, T)
);
**************************/

{
    fvScalarMatrix TEqn
    (
        fvm::ddt(T)
        + fvm::div(phi, T)
        - fvm::laplacian(DT,T)
    );

    point TRefPoint(2, 0, 0);   // metres
    label TRefCell = mesh.findCell(TRefPoint);

    Info<< "TRefCell = " << TRefCell << nl
        << "TRefValue = " << TRefValue << nl
        << endl;

    // create a labelList containing only the label TRefCell
    labelList fixedCells(1, TRefCell);

    // create a field having as many values as the labelList,
    // specifically the values we want to set
    scalarField fixedValues(fixedCells.size(), TRefValue);

    // set the values.  This eliminates the specified cells from the matrix
    TEqn.setValues(fixedCells, fixedValues);

    TEqn.solve();
}
Hopefully this works for everyone else!
Jeff
ozzythewise is offline   Reply With Quote

Old   February 24, 2012, 06:56
Default
  #23
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 490
Rep Power: 9
samiam1000 is on a distinguished road
Hi there,

I am writing since I am facing the problem you had and discussed about in this thread.

I am running a simulation and - in a certain area of my domain - I want to impose a fixed temperature. Let's say that I want to impose a boundary condition in a volume and not on a surface.

The solver I am using is buoyantSimpleFoam and I do not know which is the file that I need to edit.

Thanks a lot,

Samuele

Last edited by samiam1000; February 24, 2012 at 10:12.
samiam1000 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
Cell Reynolds Number laliong Main CFD Forum 11 March 19, 2015 12:42
incorrect temperature in pressure based solution Kian FLUENT 1 July 6, 2009 05:59
Fixed temperature for domain seojaho CFX 8 June 4, 2009 13:21
Ultra high temperature? bk CD-adapco 2 July 19, 2005 00:01
Cell Temperature using udf Karthick FLUENT 2 April 19, 2004 06:29


All times are GMT -4. The time now is 12:40.