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

Calculate maximum velocity components with functionObject

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2022, 15:01
Default Calculate maximum velocity components with functionObject
  #1
New Member
 
Join Date: Jun 2022
Posts: 19
Rep Power: 3
TommyJ is on a distinguished road
Hello,

I would like to compute the maximum of the u,v,z components of velocity with a functionObject.

I have been trying to use fieldMinMax as:


Code:
    fieldMinMax1
    {
        // Mandatory entries (unmodifiable)
        type        fieldMinMax;
        libs        (fieldFunctionObjects);

        // Mandatory entries (runtime modifiable)
        mode        component;
        fields      (U);

        // Optional entries (runtime modifiable)
        location    true;
    }

But so far I always get the same value for max and min at the same cell.

Does anyone know how to get the maximum/min of a component of a vectorField with a FO that will write the corresponding value to a log?
TommyJ is offline   Reply With Quote

Old   July 19, 2022, 04:56
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 207
Rep Power: 5
Alczem is on a distinguished road
Hey,


I can't say about monitoring specific components of the vector, but I recently used the minMax function and what worked for me was the following :


Code:
    {
        type                    fieldMinMax;
        //enabled                    true;
        libs                    ("libfieldFunctionObjects.so");
        writeControl            timeStep;
        //write                    true;
        //writeInterval           1;
        //writeToFile             yes;
        //log                     yes;
        location                yes;
        mode                    magnitude;
        fields                  (U p_rgh);
    }
The mode field seems relevant here. Hope it helps.


EDIT: I forgot to mention that the output was written in a .dat file in postProcessing/fieldMinMax/0
Alczem is offline   Reply With Quote

Old   July 19, 2022, 08:53
Default
  #3
New Member
 
Join Date: Jun 2022
Posts: 19
Rep Power: 3
TommyJ is on a distinguished road
Hi,
Thanks for the reply, but the goal is to know where the maximum and minimum of each component is located. I am aware of the magnitude mode. I wounder if it would be possible to split the components with one functionObject and "feed" it to fieldMinMax.
TommyJ is offline   Reply With Quote

Old   July 19, 2022, 11:57
Default
  #4
Senior Member
 
Join Date: Dec 2021
Posts: 207
Rep Power: 5
Alczem is on a distinguished road
Hi,


Oh I see, well maybe you could use Paraview to output the values of each field and their components, and save this as a csv file. Then use Excel to sort the rows of your datasheet by the component value (that is what I would do if I needed to do it once or twice).



I did some reading to see if there was a way to access U's components directly through the fieldMinMax function (like U.component(0) or U.x) but no shot.


Sorry ! Maybe someone else can be more helpful
Alczem is offline   Reply With Quote

Old   July 19, 2022, 12:22
Default
  #5
New Member
 
Join Date: Jun 2022
Posts: 19
Rep Power: 3
TommyJ is on a distinguished road
Quote:
Originally Posted by TommyJ View Post
Hi,
Thanks for the reply, but the goal is to know where the maximum and minimum of each component is located. I am aware of the magnitude mode. I wounder if it would be possible to split the components with one functionObject and "feed" it to fieldMinMax.
Apparently the last portion is possible :V... But I get all fields

Code:
    components1
    {
        // Mandatory entries (unmodifiable)
        type            components;
        libs            (fieldFunctionObjects);
        field           U;
    }


    fieldMinMax1
    {
        // Mandatory entries (unmodifiable)
        type        fieldMinMax;
        libs        (fieldFunctionObjects);

        // Mandatory entries (runtime modifiable)
        mode        magnitude;
        fields      (Ux);

        // Optional entries (runtime modifiable)
        location    true;
    }
TommyJ 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
time averaged and resolved velocity components raunakjung CFX 0 June 9, 2017 20:23
OpenFOAM Velocity BC two orthogonal components viv123 OpenFOAM 1 October 31, 2014 08:28
Plotting Radial and Circumferential Velocity Components for FSI modelling ashtonJ CFX 1 May 28, 2012 04:36
Compare 2D axi-symmetric and 3D. Is OpenFOAM calculate the velocity wrong? RalphS OpenFOAM 6 November 13, 2010 20:51
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 05:43.