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

How to update a volScalarField's values

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 2 Post By alexeym
  • 3 Post By dkxls
  • 1 Post By dkxls
  • 1 Post By Kummi
  • 2 Post By SHUBHAM9595

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 23, 2013, 04:09
Default How to update a volScalarField's values
  #1
Member
 
Thomas Vossel
Join Date: Aug 2013
Location: Germany
Posts: 45
Rep Power: 12
ThomasV is on a distinguished road
Hi!

I have a question concerning how to update a volScalarField. Imagine the following problem:

You have a volScalarField T for the temperature (with values applied to it). You now have another volScalarField X which is meant to consist of values depending on the respective temperatures. How do I implement an update for X which looks up the temperature of each element and then updates the value in terms of special conditions. With that I mean a procedure of this sort:

Code:
if (T<100)
{
    X = 1;
}

if (T=100)
{
    X = 2;
}

if (T>100)
{
    X = 3;
}
ThomasV is offline   Reply With Quote

 


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
Retrieving boundary patch values adjacent to a given cell brooksmoses OpenFOAM Post-Processing 2 December 8, 2008 10:00
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 12:04
Plotting raw data values Wilesco Siemens 0 January 5, 2006 05:34
Mass Flux values and calculations Cb Siemens 1 January 22, 2005 09:21
node based or cell centered Ts values acboge FLUENT 0 February 6, 2004 06:41


All times are GMT -4. The time now is 07:31.