CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   max for scalarField (http://www.cfd-online.com/Forums/openfoam-bugs/62307-max-scalarfield.html)

maka November 21, 2008 07:14

max function accepts calls lik
 
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

henry November 21, 2008 09:40

Are you referring to the max m
 
Are you referring to the max member function used for example in the form:

vsf.max(vsf, VSMALL)

H

maka November 21, 2008 10:03

No, I'm revering to the one us
 
No, I'm revering to the one used as a sand-alone function like in:

scalarField x = max(sf,VSMALL);

Thanks.

henry November 21, 2008 11:03

OK, I will add the equivalents
 
OK, I will add the equivalents for Field.

H

henry November 21, 2008 11:12

These functions already exist
 
These functions already exist in OpenFOAM-1.5 and OpenFOAM-1.5.x

H

maka November 21, 2008 11:53

Thanks Henry.
 
Thanks Henry.

maka February 19, 2009 08:23

Hi, max and min function in
 
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.

henry February 19, 2009 09:05

gMax and gMin are defined for
 
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

maka February 19, 2009 09:19

Thanks Henry. This means that
 
Thanks Henry. This means that the user only need to call min and max and they will work in parallel, right?
Best regards,
Maka.

henry February 19, 2009 09:43

For GeometricField max and min
 
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


All times are GMT -4. The time now is 08:41.