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

PID control of valve using the immersed boundary method in foam-extend

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2020, 22:52
Default PID control of valve using the immersed boundary method in foam-extend
  #1
New Member
 
Goon
Join Date: Apr 2020
Posts: 8
Rep Power: 6
qkrtjdrns is on a distinguished road
Hi. Now I am trying to develop the model which enables PID control of valve using the immersed boundary method of the foam-extend. The inflow velocity is fixed and the pressure difference before and after the valve is determined by the degree of valve opening and closing. Please see the attached gif file which shows the result of modeling and pressure contour.

In this situation, I want to control the position of the valve to adjust the predetermined pressure difference (goal of the pressure difference) through the PID control algorithm.

I made the executable file using pimpleDyMIbFoam.C.

I calculated the pressure difference before and after the valve using libfieldFunctionObjects.so and faceSource class. Thus the pressure difference is calculated every time step and appeared in log.result file well.

I made the change in dynamicDict to read the pressure difference goal, KP, KI, KD and made the new library 'libvalveControl.so' (it is modified from libsolidBodyMotion.so and build from user-defined valveControl.C) where the valve position will be determined based on the PID control algorithm.

The only left part is to transfer value of the pressure difference calculated using libfieldFunctionObjects.so to valveControl.C. I can change the valve based on the below equation but valveControl.C needs the value of the calculated pressure difference before and after the valve.
valveOpening(t) = Kp*(P_goal - P_calculated(t)) + KI*Integral{P_goal - P_calculated(t)} + KD * Differential{P_goal - P_calculated(t)}

In the log file (log.result), the pressure difference seems to be calculated properly at every time step. But I really do not know how I can use the value of the pressure difference that is obtained in one post-processing library (libfieldFunctionObjects.so) in another library (libvalveControl.so which is modified from libsolidBodyMotion.so) to move the valve based on the PID algorithm.

Thus, the question is how to transfer the value obtained in one library to another library?

Thanks for reading my problem.
Any comments will help me a lot.

Sincerely
Goon
Attached Images
File Type: gif pressure contour.gif (17.4 KB, 7 views)

Last edited by qkrtjdrns; April 1, 2020 at 23:47. Reason: Question added.
qkrtjdrns is offline   Reply With Quote

Old   April 3, 2020, 11:57
Default
  #2
New Member
 
Goon
Join Date: Apr 2020
Posts: 8
Rep Power: 6
qkrtjdrns is on a distinguished road
Any comments please?

Is there any way to transfer pressure data calculated in the flow field into mesh motion (solid body motion) ?
qkrtjdrns 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
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Moving mesh (dynamic motion) with immersed boundary - foam extend 4.0 abavo OpenFOAM Running, Solving & CFD 0 August 2, 2018 10:25
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field xiexing CFX 3 March 29, 2017 11:00
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


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