CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Scheme command for volume-average value (https://www.cfd-online.com/Forums/fluent-udf/136330-scheme-command-volume-average-value.html)

cicatrix May 26, 2014 22:54

Scheme command for volume-average value
 
Hi guys.

I am doing some works about monitoring and changing boundary conditions
with scheme language.


I already know how to get area-weighted-avg temperature like below.

These two TUI commands are same. One is scheme and another one is journal command.

(define check_temp (surface-area-average (list (surface-name->id thermostat)) "temperature"))
;; Scheme command

/report/surface-integrals/area-weighted-avg thermostat () temperature ,
;; Journal command


But, I do not know how to get volume-average temperature and heat source value in specific cell zone with scheme.

Is there a anybody who can help me?

pakk May 27, 2014 04:52

I looked at the User manual, Fluent Text Command list.

You already found "/report/surface-integrals/area-weighted-avg"
But now you don't want a surface integral but a volume integral, so I looked further:
Quote:

volume-integrals/
Enter the volume integral menu.
...
volume-avg
Print volume-weighted average of scalar over cell zones.

So the journal command you are looking for is "/report/volume-integrals/volume-avg".

cicatrix May 27, 2014 10:09

Thanks for your helpful explanation.

But I need to know scheme commands to make some codes which can control temperature and source term.

pakk May 27, 2014 11:11

You can turn every journal command into a scheme command by using "(ti-menu-load-string ...)"

So in this case:
Quote:

(ti-menu-load-string "//report/volume-integrals/volume-avg volumename temperature")

cicatrix May 27, 2014 19:37

I know (ti-menu-load-string ...) can do measure volumename's temperature.

But I need to store variables in memory using the scheme commands.

(ti-menu-load-string ...) can just returen #f or #t.

pakk May 28, 2014 02:09

OK, you didn't mention yet that you wanted to use the value, and not just print it.

I now understand your problem, but don't know the solution. I am interested to know the answer, though...

Heat80 November 12, 2014 20:48

Quote:

Originally Posted by cicatrix (Post 494241)
Hi guys.

I am doing some works about monitoring and changing boundary conditions
with scheme language.


I already know how to get area-weighted-avg temperature like below.

These two TUI commands are same. One is scheme and another one is journal command.

(define check_temp (surface-area-average (list (surface-name->id thermostat)) "temperature"))
;; Scheme command

/report/surface-integrals/area-weighted-avg thermostat () temperature ,
;; Journal command


But, I do not know how to get volume-average temperature and heat source value in specific cell zone with scheme.

Is there a anybody who can help me?

--------------------------------------------------------------------
(ti-menu-load-string (format #f "report volume-int va thermostat () temperature yes yourfilename yes"))
------------------------------------------------------------------
Hopefully not too late

macfly November 12, 2014 20:52

Quote:

Originally Posted by Heat80 (Post 518868)
--------------------------------------------------------------------
(ti-menu-load-string (format #f "report volume-int va thermostat () temperature yes yourfilename yes"))
------------------------------------------------------------------
Hopefully not too late

probably volume-average instead of volume-int

Heat80 November 15, 2014 21:35

Quote:

Originally Posted by macfly (Post 518869)
probably volume-average instead of volume-int

You right. You can also divide the volume integral result by domain volume as another way to get the average value over the domain.

cicatrix November 20, 2014 07:53

I solved with follwing scheme commands.

(%fill-node-values 'temperature)
(define Temp_A (%volume-integrals 'volume-average '(Cell Zone ID) "temperature"))

;; Temp_A is a variable name what you want to make
;; You can get Cell Zone ID in cell zone conditions in flunet window.


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