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

Limit a volVectorField

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By edsaac

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2022, 21:59
Default Limit a volVectorField
  #1
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
Hi,

I want to limit a volVectorField to max and min vector ( one to one ). I know there is min, max function for VolScalarField. Is there something similar to volVectorField?

Stanley
sjohn2 is offline   Reply With Quote

Old   June 16, 2022, 10:15
Default
  #2
Member
 
Join Date: Jan 2022
Location: Germany
Posts: 72
Rep Power: 4
überschwupper is on a distinguished road
If you want to limit the the field, then you should go for fvConstraints.


To answer your question:
yes there is such a function, that returns the min and max value


You can see all members here:


https://cpp.openfoam.org/v9/classFoa...tricField.html


and specifically here (and below)
https://cpp.openfoam.org/v9/classFoa...f3511e01db1fc6
überschwupper is offline   Reply With Quote

Old   June 16, 2022, 12:30
Default
  #3
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
Thanks for your reply,
most of this examples deal with a volScalarField or a tensorField,
any thing for volVectorField?
sjohn2 is offline   Reply With Quote

Old   June 17, 2022, 16:46
Default
  #4
New Member
 
Join Date: Aug 2016
Location: USA
Posts: 5
Rep Power: 9
edsaac is on a distinguished road
Keep in mind that max and min are evaluated element by element in a vector, not based in their magnitude. For instance,


Code:
#include "fvCFD.H"

int main(int argc, char *argv[])
{
    vector zeros   (0,0,0);
    vector numbers (-10,-1,10);
    Foam::Info << Foam::max(zeros,numbers) << endl;

    dimensionedVector dimZeros   ("dimZeros",dimless,zeros);
    dimensionedVector dimNumbers ("dimNumbers",dimless,numbers);
    Foam::Info << Foam::max(dimZeros,dimNumbers) << endl;
}
Returns,


Code:
(0 0 10)
max(dimZeros,dimNumbers) [0 0 0 0 0 0 0] (0 0 10)
I think it should work the same for volVectorField as they all share the same template.
dlahaye likes this.
edsaac 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 update volVectorField from files newOpenfoamUser OpenFOAM Programming & Development 0 September 20, 2021 06:44
Trouble accessing volVectorField while decomposing petros OpenFOAM Programming & Development 6 July 31, 2021 06:43
What is the Packing Limit and Friction Packing Limit? rezasalehi FLUENT 0 October 13, 2018 15:37
how to increase "Newton Pressure Iteration Limit" kus CFX 9 April 21, 2013 01:54
Image size limit Far Site Help, Feedback & Discussions 0 January 13, 2013 10:45


All times are GMT -4. The time now is 17:07.