CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF to modify coordinates in Moment Monitor

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Kokemoor

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 8, 2015, 12:09
Default UDF to modify coordinates in Moment Monitor
  #1
New Member
 
Alessandro
Join Date: May 2014
Posts: 2
Rep Power: 0
Alex9090 is on a distinguished road
Hi all,

I have to modify the moment centre and the moment axis in the "moment Monitor" with a function of time. It's possible at every time-step change these values?

For the mesh motion in the cell zone condition I did with a "DEFINE_ZONE_MOTION".

It's a simulation with a dynamic mesh and I was able to do.


Thank you very much

Alessandro
Alex9090 is offline   Reply With Quote

Old   June 9, 2015, 10:46
Default
  #2
Senior Member
 
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 13
Kokemoor is on a distinguished road
This might be a job for a scheme macro rather than a UDF. If your moment center varies with time in a complex way, you could do that in a UDF and write it to a scheme variable with RP_Set_Real. If its simpler, you could calculate it in scheme. Then, create a macro that changes the moment monitor, something like:

Code:
(cx-macro-define '(
(moment-update . "
(ti-menu-load-string \"solve/monitors/force/set-moment-monitor monitorname y 123 , y y moment-history.txt n n (rpgetvar 'xc) (rpgetvar 'yc) (rpgetvar 'zc) 0 0 0\")
")))
where xc, yc, and zc are the scheme variables containing the moment center components. You'll have to change the details to match your setup, but that's the gist of the approach I would use. Then you simply set up a Calculation Activity that runs your macro every iteration.
Alex9090 and Yufei like this.
Kokemoor is offline   Reply With Quote

Old   June 11, 2015, 10:47
Default
  #3
New Member
 
Alessandro
Join Date: May 2014
Posts: 2
Rep Power: 0
Alex9090 is on a distinguished road
Thank you very much Kookemoor!

It's working on my computer but not in the cluster.

At the end I used wrote this command directly in the command line of "Calculation Activities --> Execute commands"

Code:
 (Define t (rpgetvar'flow-time)) solve/monitors/force/set-moment-monitor cm-p y 53 55 57 61 58 59 56 60 , y y mom-tot.txt n n 0 0 -6 (sin (* 0.0872 (sin (* 25 t)))) 0 (cos (* 0.0872 (sin (* 25 t))))
It's strange that after the first iteration it stopped but if I run again the simulation it works perfect.
The error is:
" Error: GENERAL-CAR-CDR: invalid argument [1]: improper list
Error Object: () "


The problem is that I want to run the simulation in the cluster of my University but in the HPC fluent read the command but doesn't write the file.txt.

Do you have any idea?

Thank you again.
Alex9090 is offline   Reply With Quote

Old   June 11, 2015, 11:13
Default
  #4
Senior Member
 
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 13
Kokemoor is on a distinguished road
It might be a rights issue? You could try writing to a network location. Instead of "mom-tot.txt" have "\\computername\folder\mom-tot.txt".
Kokemoor is offline   Reply With Quote

Reply

Tags
udf; moment monitor


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
UDF: Given coordinates, How to identify the cell? Zhang Fluent UDF and Scheme Programming 26 August 15, 2022 05:54
modify a intern variable of Fluent with scheme and UDF fanch33 Fluent UDF and Scheme Programming 3 March 2, 2015 11:01
How can I modify surface reaction using UDF Juun Fluent UDF and Scheme Programming 0 July 28, 2014 09:13
UDF Wall Temperature Problem - Coordinates Marc FLUENT 1 July 3, 2008 11:10
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


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