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

max for scalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2008, 07:14
Default max function accepts calls lik
  #1
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
max function accepts calls like:

volScalarField vsf = ...;
max(vsf, VSMALL);

But does not accept similar calls like:
scalarField sf = ...;
max(sf, VSMALL);

Usually the latter is need when creating boundary condition of wallFunction type. This refers to V1.3; Thanks.

Best regards,
Maka
maka is offline   Reply With Quote

Old   November 21, 2008, 09:40
Default Are you referring to the max m
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Are you referring to the max member function used for example in the form:

vsf.max(vsf, VSMALL)

H
henry is offline   Reply With Quote

Old   November 21, 2008, 10:03
Default No, I'm revering to the one us
  #3
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
No, I'm revering to the one used as a sand-alone function like in:

scalarField x = max(sf,VSMALL);

Thanks.
maka is offline   Reply With Quote

Old   November 21, 2008, 11:03
Default OK, I will add the equivalents
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
OK, I will add the equivalents for Field.

H
henry is offline   Reply With Quote

Old   November 21, 2008, 11:12
Default These functions already exist
  #5
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
These functions already exist in OpenFOAM-1.5 and OpenFOAM-1.5.x

H
henry is offline   Reply With Quote

Old   November 21, 2008, 11:53
Default Thanks Henry.
  #6
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
Thanks Henry.
maka is offline   Reply With Quote

Old   February 19, 2009, 08:23
Default Hi, max and min function in
  #7
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
Hi,

max and min function in the following code behaves correctly (they consider cell and patch values) but gMax, gMin does not (they only consider cell value but NOT the patch values)

// calculate unit vector in wall normal direction for the boundary patches.
volVectorField wallNormal(reflectionVectors(mesh_).n());


Info << "gMax,gMin(wallNormal)" << gMax(wallNormal) << " " << gMin(wallNormal) << endl;

Info << "max,min(wallNormal)" << max(wallNormal) << " " << min(wallNormal) << endl;

This is V1.3

Best regards,
Maka.
maka is offline   Reply With Quote

Old   February 19, 2009, 09:05
Default gMax and gMin are defined for
  #8
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
gMax and gMin are defined for Field not GeometricField and calling them for a GeometricField simply calls the functions defined for the internal field as you have found. The GeometricField max and min call gMax and gMin of the internal Field and boundary FieldField. So the behavior you see is the design behavior.

H
henry is offline   Reply With Quote

Old   February 19, 2009, 09:19
Default Thanks Henry. This means that
  #9
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
Thanks Henry. This means that the user only need to call min and max and they will work in parallel, right?
Best regards,
Maka.
maka is offline   Reply With Quote

Old   February 19, 2009, 09:43
Default For GeometricField max and min
  #10
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
For GeometricField max and min work in parallel, i.e. they do reductions over the processors. For Field max and min do not do reductions as this would not be the correct default behavior for all usages of Field and gMax and gMin should be used if the parallel-reduced value is required.

H
henry 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 sum up scalarField wese OpenFOAM Running, Solving & CFD 2 August 19, 2019 17:30
How to set up an AUTO_WRITE scalarField xiao OpenFOAM Running, Solving & CFD 9 July 22, 2010 03:23
ScalarField division maka OpenFOAM Pre-Processing 2 August 27, 2007 05:10
[CGNS] Computing a cellcentered scalarField from a vertexcentered scalarField mbeaudoin OpenFOAM Meshing & Mesh Conversion 10 February 22, 2007 07:43
Replacing components in a scalarField grtabor OpenFOAM Running, Solving & CFD 1 February 5, 2007 12:24


All times are GMT -4. The time now is 10:55.