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

What does MRF.correctBoundaryVelocity(U) do in OpenFOAM8?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By nepomnyi
  • 1 Post By crpvn
  • 2 Post By crpvn

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 11, 2022, 12:59
Default What does MRF.correctBoundaryVelocity(U) do in OpenFOAM8?
  #1
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Hello dear CFDOnline community.


I've been trying to find the equation behind the function MRF.correctBoundaryVelocity(U) given in the file UEqn.H on line 3.


I concluded that the dot operator, in this case, means that we are accessing the method correctBoundaryVelocity of the class MRF.



So - not with ease - I found the class MRF. And, indeed, it has correctBoundaryVelocity as a member function. See line 174 in the file MRFZoneList.H. The definition of correctBoundaryVelocity is given in the file MRFZoneList.C on lines 376-382.


There - again - correctBoundaryVelocity is given as a method of the class operator[]. So, I found that operator[] class in the file UPtrListl.H on lines 95-108.



operator[] happens to be templated from the class T. That's where I have a problem: I haven't been able to find class T. Moreover, in the header of the List.H file, I read that it is, actually, a class of type T which I have no idea what that means.


I read here that Foam::T has to do with transposing matrices, but that's the only thing I was able to find. Searching Foam namespace list didn't reveal T to me.


Thus, I'm wondering 1) what MRF.correctBoundaryVelocity does, 2) what formula it uses and 3) where I can find the underlying code for it.


Thank you in advance.
Ivan


P.S. Regarding suggestions to learn C++ first which I anticipate. They are right indeed. But I don't have time for that. I need to complete the task of figuring out the formulas behind the code that I intend to use. That's an urgent task. I'm learning C++ simultaneously. But I'm at the very early stages of learning C++. People in academia should understand me. When you're in Ph.D. you do a lot of tasks simultaneously and the idea is to get the task done by any means on time with minimum knowledge. That's why I'm seeking help from the community while I - myself - don't have knowledge, yet, to figure out the solution.
Dcn likes this.
nepomnyi is offline   Reply With Quote

Old   November 15, 2022, 12:32
Default A partial solution
  #2
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
I suspect I have found a partial solution.


MRF seems to be a folder containing several files with code (see here the MFR tree on the left hand side of the page).



Evidently, correctBoundaryVelocity method may occur in several files within the folder.


Like I mentioned in my original post, I had found correctBoundaryVelocity method in the file MRFZoneList.H. Following that file, led me to a dead end. I'm not sure what those lists are.


I searched the rest of the files within the MRF folder and I found correctBoundaryVelocity declaration in the file MRFZone.H on line 255 and definition in the file MRFZone.C on lines 541-568.


Even though I still have to decipher what's written on lines 541-568 in the file MRFZone.C, preliminary, it looks like what I need: the formula for correctBoundaryVelocity.


If it is so and once I've deciphered it, I'll post the formula in my blog.


Ivan


P.S. For those interested, <class T> is a special thing in C++ that allows you to give any type to the variable. I.e. T is a C++ keyword meaning any type (type can be int, double and so on). See here (scroll down to "Class templates" section).
nepomnyi is offline   Reply With Quote

Old   November 15, 2022, 15:56
Default
  #3
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
crpvn is on a distinguished road
Hello Ivan,

I think that correctBoundaryVelocity method changes velocity for the patches that are boundary of the MRF zone.

It works correctly when fixedValue 0 is applied as BC for U, but it doesn't when rotatingWallVelocity is applied, as explained in this issue:
https://develop.openfoam.com/Develop.../-/issues/1810

I hope it helps.
nepomnyi likes this.
crpvn is offline   Reply With Quote

Old   November 16, 2022, 04:16
Default
  #4
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
crpvn is on a distinguished road
Also this document could be useful:

https://www.google.com/url?q=http://...fvp1OfoXWH8H-K
crpvn is offline   Reply With Quote

Old   November 17, 2022, 12:50
Default
  #5
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Quote:
Originally Posted by crpvn View Post
Also this document could be useful:

https://www.google.com/url?q=http://...fvp1OfoXWH8H-K

Hello @crpvn, thank you very much.


The link wouldn't open. The Internet search didn't give me the document as well. I was wondering if you could attach the document please.



Also I was wondering if you could clarify your previous answer please.


First is MRF. People seem to use it as something obvious. However, I have no idea, whatsoever, what that means. Digging through the Internet, I found out that MRF stands for multi reference frame (which, again, doesn't tell me anything). Apart from that, I've got a feeling that people refer to non-stationary flow boundaries when using the term MRF. E.g., flapping airfoil is MRF, or rotating cylinders are MRF, but just a regular stationary pipe is not MRF. Am I right?


Second, you said "I think that correctBoundaryVelocity method changes velocity for the patches that are boundary of the MRF zone." What did you imply saying "changes"? What change did you mean? Did you mean that the user assigns boundary condition (velocity in this case) in the absolute frame of reference, and the function converts it to the relative frame of reference? Or something like that. I don't need the exact answer, I just need to get a very general feeling of what's going because I don't have any non-stationary boundaries in my problem.


Thank you in advance.



Ivan
nepomnyi is offline   Reply With Quote

Old   November 19, 2022, 04:58
Default
  #6
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
crpvn is on a distinguished road
Hello,

The document is "Methods for wheel rotation modelling" by Chalmers University, where MRF approach is explained in details.
http://www.tfd.chalmers.se/~hani/kur..._Josefsson.pdf



At this link you can find the mathematical details for MRF development.

https://openfoamwiki.net/index.php/S...RF_development


If you apply fixedValue 0 as BC for a wall inside an MRF zone, wall velocity will be changed as omega X R, instead 0 value.
hadisafaei and nepomnyi like this.
crpvn 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 interpret the arguments of fvc::grad function in OpenFOAM8? nepomnyi OpenFOAM Programming & Development 1 October 26, 2022 04:55
Changes in OpenFOAM8 concerning the buoyantSimpleFoam solver ? laurentD OpenFOAM Running, Solving & CFD 3 March 24, 2022 08:14
createBaffles() geometry issue -OpenFoam8 vivek_glasswala Main CFD Forum 0 November 30, 2021 12:17
[blockMesh] #codeStream loop inside a blockMeshDict francois OpenFOAM Meshing & Mesh Conversion 31 March 13, 2021 12:29
[OpenFOAM.org] E: Unable to locate package openfoam8 Puneet_Pushkar OpenFOAM Installation 3 October 8, 2020 02:27


All times are GMT -4. The time now is 23:12.