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

Fixed Temperature Cell in Solution

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2011, 16:15
Default
  #21
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
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: 16
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, 05:56
Default
  #23
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
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 09:12.
samiam1000 is offline   Reply With Quote

Reply


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
Cell Reynolds Number laliong Main CFD Forum 12 September 17, 2019 03:18
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 Siemens 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 16:30.