|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 7 ![]() |
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 |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
Are you referring to the max member function used for example in the form:
vsf.max(vsf, VSMALL) H |
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 7 ![]() |
No, I'm revering to the one used as a sand-alone function like in:
scalarField x = max(sf,VSMALL); Thanks. |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
OK, I will add the equivalents for Field.
H |
|
|
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
These functions already exist in OpenFOAM-1.5 and OpenFOAM-1.5.x
H |
|
|
|
|
|
|
|
|
#6 |
|
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 7 ![]() |
Thanks Henry.
|
|
|
|
|
|
|
|
|
#7 |
|
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 7 ![]() |
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. |
|
|
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
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 |
|
|
|
|
|
|
|
|
#9 |
|
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 7 ![]() |
Thanks Henry. This means that the user only need to call min and max and they will work in parallel, right?
Best regards, Maka. |
|
|
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
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 |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to set up an AUTO_WRITE scalarField | xiao | OpenFOAM Running, Solving & CFD | 9 | July 22, 2010 03:23 |
| How to sum up scalarField | wese | OpenFOAM Running, Solving & CFD | 0 | March 14, 2008 08:50 |
| ScalarField division | maka | OpenFOAM Pre-Processing | 2 | August 27, 2007 05:10 |
| 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 |