|
[Sponsors] |
November 28, 2016, 06:58 |
Inquire about the max() function in OpenFOAM
|
#1 |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 10 |
Hey there!
I'm confused about how the max() function works. Currently I'm making a AMR sensor using gradrho &gradU Code as following: In rhoCentralFoam.C ,I add this lines. Code:
//----------------------------sensor-------------------------------------// volScalarField Uy = mag(U.component(vector::Y)); volVectorField gradUy = fvc::grad(Uy); volScalarField gradUyy = mag(gradUy.component(vector::Y)); gradUyyN = gradUyy/max(gradUyy); // using tensor volTensorField gradU0 = fvc::grad(U); volScalarField gradU1 = mag(gradU0.component(tensor::YY)); gradUtN = gradU1/max(gradU1); volScalarField gradrho = mag(fvc::grad(rho)); gradrhoN = gradrho/max(gradrho); //----------------------------sensor-------------------------------------// For using as sensor I want it ranges from 0-1. gradrhoN works fine,and it's value range from 0-1. But,the range of gradUyyN or gradUtN (which has the same value) shows a changing range approximately from a non-zero extremly small value to about 0.5. Why the max value / max value is not 1? thank you |
|
November 29, 2016, 10:28 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17 |
Are you testing this code in parallel?
|
|
November 29, 2016, 10:30 |
hi
|
#3 |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 10 |
||
November 29, 2016, 10:37 |
|
#4 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17 |
Exactly, that's why I asked. But if you are running on single processor, max() should work fine.
|
|
November 29, 2016, 10:44 |
|
#5 | |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 10 |
Quote:
gradrhoMag = mag(gradrho); gradrhoMax = max(gradrhoMag); when I check the value of gradrhoMag and gradrhoMax, the maximum of gradrhoMag=gradrhoMax, but when I use max() for doing gradU,it's not work. the value is almost twice bigger than the maximum of gradUMag. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 05:29 |
Problem of simulating of small droplet with radius of 2mm | liguifan | OpenFOAM Running, Solving & CFD | 5 | June 3, 2014 02:53 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 05:42 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 10:23 |
Can anybody help me to solve the list errors while compiling Openfoam 15 on Opensuse 103 32bit | coompressor | OpenFOAM Installation | 0 | November 12, 2008 19:53 |