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

How to manipulat a volScalarField like this...

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2010, 17:38
Default How to manipulat a volScalarField like this...
  #1
New Member
 
Xingzhi You
Join Date: May 2010
Posts: 7
Rep Power: 15
masspec is on a distinguished road
Hey there,

I get a volScalarField A,and another volScalarField B. And B is dependent on A as follows:

if the value of a particular element in A is larger than a threshold,
then the corresponding value of that element in B is a function of A as f1.

else the value of B is a function of A as f2.

I do not know how can I manipulate the volScalarField to attain such objective, and looking for some help......

Thanks a lot.
masspec is offline   Reply With Quote

Old   June 22, 2010, 20:29
Default
  #2
New Member
 
Hans
Join Date: Jun 2010
Posts: 2
Rep Power: 0
tiddlycorona is on a distinguished road
I think what you need is just how to have access to the field value at a cell, judge it and accordingly made modification to another field.

forAll (A, celli) {

if (A[celli]) > Threshold)
B[celli] = f1(A[celli]);
else
B[celli] = f2(A[celli]);

}


Not sure if it is right. Hope more experienced Foamers can tell us how to do it.
tiddlycorona 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 create initiate a volScalarField p without reading from disk NO_READ does not seem to work dbxmcf OpenFOAM Running, Solving & CFD 14 March 25, 2022 06:08
if-loop, volScalarField comparison volker OpenFOAM 7 March 6, 2020 20:03
Problems with creating a volScalarField georlade OpenFOAM Programming & Development 4 December 4, 2016 12:31
Definition of a linear function as volScalarField titio OpenFOAM Running, Solving & CFD 1 October 3, 2010 16:51
dimensioned volScalarField lions85 OpenFOAM 1 November 12, 2009 02:41


All times are GMT -4. The time now is 23:29.