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

How to get cell face temperature??

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ARTem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2013, 15:57
Default How to get cell face temperature??
  #1
Member
 
George Pichurov
Join Date: Jul 2010
Posts: 52
Rep Power: 16
jorkolino is on a distinguished road
Hi,

I need the boundary cell face temperature to use in an expression. How can I access it in the code ? For example, I can define boundary field like:

Code:
        const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
            heatFlux.boundaryField();
(where heatFlux is a SurfaceScalarField entity). However, expression like T.boundaryField() ( instead of heatFlux.boundaryField() )produces an error. Why the temperature cannot have a boundary field defined like that?

Ed. I am maybe heading into some sort of a solution, but I have a question. Why is the h field (probably enthalpy) recognized when adressed in the code, and T field is not? The brutal example is I can interpolate fvc::interpolate(h) and take gradient fvc::snGrad(h), but non of these with T. I am customizing the wallHeatFlux utility, by the way.

Last edited by jorkolino; July 19, 2013 at 18:52.
jorkolino is offline   Reply With Quote

Old   July 22, 2013, 05:24
Default
  #2
Member
 
Artem Shaklein
Join Date: Feb 2010
Location: Russia, Izhevsk
Posts: 43
Rep Power: 16
ARTem is on a distinguished road
Hello, jorkolino.

Any field type has boundaryField (bF). But as far as I know, there are different types of bF (e.g. surfaceScalarField.bF() and volScalarField.bF() are not same even on same mesh). i don't know the details of that inconsistency, but this should do the job:
const volScalarField::GeometricBoundaryField& Tpatch =T.boundaryField();

The most robust choise is to use cycle (e.g. you want to make some algebraical operations with boundaryFields of vol (vf) and surfaceFields(sf)).

Code:
forAll(sf.boundaryField(), patchi)
{
  forAll(sf.boundaryField()[patchi], facei)
  {
    sf.boundaryField()[patchi][facei] += fv.boundaryField()[patchi][facei];
  }
}
But be accurate with dimensions, because type of sf.boundaryField()[patchi][facei] is scalar (or double in c++) and dimensions checking isn't done here.
codder likes this.
ARTem 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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
Cells with t below lower limit Purushothama Siemens 2 May 31, 2010 22:58
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 23:50
How to determine the direction of cell face vectors on processor patches sebastian_vogl OpenFOAM Running, Solving & CFD 0 October 27, 2009 09:47
how to access each cell of a face? (user fortran) Katariina CFX 3 January 28, 2008 10:16


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