CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Extract average pressure (https://www.cfd-online.com/Forums/fluent-udf/90081-extract-average-pressure.html)

 pH-ich June 30, 2011 04:48

Extract average pressure

Hello everyone,

today I do a trainning session for my study.

I have to automate the oppening of flaps during a fluent calculation. In fluent it means change the surface representing the flap from wall to interior.

For this purpose I want to test the average pressure on the surface with my reference pressure. But I can't extract the average pressure alone so I can't run the test.

Anyone has an idea to help me ?

Sincerely.

 Micael June 30, 2011 12:36

Can you give more details about the system and what you want to do?

 pH-ich June 30, 2011 14:01

To resume, I have a box with a surface on a face. At the beginning all the face are defined as walls. There is another cube inside that produces energy and mass. So, with the time, the pressure grows inside the box.
I want automate the transition of the flap from wall to interior when the reference pressure is reached.

During the afternoon I found a solution. Export a profil from a point created in front of the flap. And with a command read the list inside the text file and do some operation on it to keep only the pressure. Like that i can operate a condition between this pressure and the reference pressure. But it's quite heavy...

Do you have another idea to extract the pressure from a point or the average pressure on a face and operate a condition on it ?

When i'll be able, I post the part of my code that refer to this.

 pH-ich July 1, 2011 04:29

Below a macro which could do that :

(cx-macro-define
'(
(macro_test_pression_flap_1 . "
(define port1 (open-input-file \"pression_flap_1.prof\"))
(define a (list-ref (list-ref (read port1) 4) 1))
(close-input-port port1)
( cond (
(> a (rpgetvar 'auto/PF_1))
(begin
)
)

)
")

))

But, it isn't... The macro works when I call it in the text interface but it doesn't work when it is automacly called throw an "execute command" in the "calculaton activities"....

 pH-ich July 1, 2011 06:05

In fact I wrote again manualy the first sentence of my macro and it is working perfectly.

But if you have other idea that avoid to write in a file and read it after, I am open !

 Micael July 5, 2011 17:27

It is an interesting problem and it seems to me that your approach it good (exeption of write-and-read detour). However, I have very little experience with Scheme language, I don't know how you can efficiently get and use the pressure value. If you find a neat solution, post it here. Good luck. :)

 pH-ich July 7, 2011 05:57

Thanks for your comments. I did found another solution to extract my pressure. This is the reason why I continu to read and post on this subject :-)
I agree with you, the detour write-and-read is flimsy but I didn't find another way.
I tried to put in a variable a report (for example the vertex-maximum of a surface) but it didn't work at all...

So I'm open-minded to your suggestions .

Sincerely.

 All times are GMT -4. The time now is 02:50.