|
[Sponsors] |
June 15, 2022, 21:59 |
Limit a volVectorField
|
#1 |
Member
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7 |
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 |
|
June 16, 2022, 10:15 |
|
#2 |
Member
Join Date: Jan 2022
Location: Germany
Posts: 72
Rep Power: 4 |
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 |
|
June 16, 2022, 12:30 |
|
#3 |
Member
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7 |
Thanks for your reply,
most of this examples deal with a volScalarField or a tensorField, any thing for volVectorField? |
|
June 17, 2022, 16:46 |
|
#4 |
New Member
Join Date: Aug 2016
Location: USA
Posts: 5
Rep Power: 9 |
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; } Code:
(0 0 10) max(dimZeros,dimNumbers) [0 0 0 0 0 0 0] (0 0 10) |
|
|
|
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 |