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

Solar calculator daily cycle update

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2021, 11:43
Default Solar calculator daily cycle update
  #1
New Member
 
Plamen Avramov
Join Date: Mar 2021
Posts: 2
Rep Power: 0
Plak is on a distinguished road
Hello everyone,

I am trying to do a long time simulation, after doing some serious approximations, using the Solar Load Model. I am doing thermal research for the SWGO (Southern Wide-field Gamma-ray Observatory) and I want to simulate a water tank for about a month (or more) in 15 minute time steps using the solar load and see if the water freezes.

I already have some UDF for real data I have, but once I pass midnight Fluent starts asking me to fix the hour. Doing this with journal files is not a great solution for me as I already have user-defined values for the sun intensity, ambient temperature, heat coefficients, etc.

Is there any way for fluent to do that on its own or even using some UDF?
I found a TUI command that adjusts the solar calculator position:
/define/models/radiation/solar-calculator 40.7 -74.1 1 0 0 -1 1 0 0 19 7 0 0 y 1 ;set your correct location, date, time and mesh orientation etc.

Is there a way that I can call this TUI command from a UDF? I will call it near midnight passing the hour and date to the next day.

Using ANSYS 19.2

Thank you in advance

Best Regards

Plamen
Plak is offline   Reply With Quote

Old   March 28, 2021, 23:46
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you may try to use:
Code:
CX_Interpret_String(ti-menu-load-string (format #f "/define/models/radiation/solar-calculator 40.7 -74.1 1 0 0 -1 1 0 0 19 7 0 0 y 1" ));
other way is to have scheme script, which will monitor some criteria calculated in your UDF
under some condition scheme scrip will execute whatever you want
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   March 29, 2021, 06:52
Default
  #3
New Member
 
Plamen Avramov
Join Date: Mar 2021
Posts: 2
Rep Power: 0
Plak is on a distinguished road
Thank you a lot for your answer.

I managed to go around this by using a journal file with multiple commands (approx 1440 lines for a year to be precise).

I used the define solar calculator and then set up the time step, number of time steps and iterations, after doing them, the journal file keeps reading the next lines without stopping and so on for every day of the year.

NOTE: In order to be able to reset the time flow and back to 0 hours, the command (rpsetvar 'flow-time 0); is needed from the second day onwards.

I hope this is useful for someone in the future, there is small amount of information about it.
;
/define/models/radiation/solar-calculator -23.017 -67.753 -4 1 0 0 0 0 1 1 1 0 10 y 1 ;
/solve/set/time-step 900 ;
/solve dt 96 30 ;
;
/define/models/radiation/solar-calculator -23.017 -67.753 -4 1 0 0 0 0 1 2 1 0 10 y 1 ;
(rpsetvar 'flow-time 0);
/solve dt 96 30 ;
;
/define/models/radiation/solar-calculator -23.017 -67.753 -4 1 0 0 0 0 1 3 1 0 10 y 1 ;
(rpsetvar 'flow-time 0);
/solve dt 96 30 ;
;

Best Regards

Plamen
Plak is offline   Reply With Quote

Old   June 24, 2021, 07:55
Default
  #4
New Member
 
Join Date: Jun 2021
Posts: 1
Rep Power: 0
HelloThere is on a distinguished road
Quote:
Originally Posted by Plak View Post
Thank you a lot for your answer.

I managed to go around this by using a journal file with multiple commands (approx 1440 lines for a year to be precise).

I used the define solar calculator and then set up the time step, number of time steps and iterations, after doing them, the journal file keeps reading the next lines without stopping and so on for every day of the year.

NOTE: In order to be able to reset the time flow and back to 0 hours, the command (rpsetvar 'flow-time 0); is needed from the second day onwards.

I hope this is useful for someone in the future, there is small amount of information about it.
;
/define/models/radiation/solar-calculator -23.017 -67.753 -4 1 0 0 0 0 1 1 1 0 10 y 1 ;
/solve/set/time-step 900 ;
/solve dt 96 30 ;
;
/define/models/radiation/solar-calculator -23.017 -67.753 -4 1 0 0 0 0 1 2 1 0 10 y 1 ;
(rpsetvar 'flow-time 0);
/solve dt 96 30 ;
;
/define/models/radiation/solar-calculator -23.017 -67.753 -4 1 0 0 0 0 1 3 1 0 10 y 1 ;
(rpsetvar 'flow-time 0);
/solve dt 96 30 ;
;

Best Regards

Plamen
Hello,

I'm running into a similar issue and I was wondering if you could give a little more detail on how you solved this as I'm fairly new to Fluent so don't fully understand everything you are talking about. Do I need to set up a file with these commands? and how is that read into Fluent?

Sorry to be a bother.

Cheers
HelloThere is offline   Reply With Quote

Old   June 25, 2021, 01:52
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
usually you will run code above using journal file.
journal file is any text file with list of directives for fluent
to run it use fluent interface:
file-> read-> journal
HelloThere likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
solar calculator, tui, udf


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
Odd results with solar load me3840 OpenFOAM Running, Solving & CFD 2 January 11, 2022 06:07
Modelling solar and thermal radiation in CSP solar receiver Gioacchino La Rochelle CFX 1 November 15, 2018 08:52
Profile Update Interval in Process Cycle Time oozcan FLUENT 0 August 3, 2016 07:38
Ansys Analysis and Simulate Solar Panel Johnny leow FLUENT 0 November 25, 2015 19:21
Solar Calculator Dorasemon FLUENT 1 July 25, 2013 10:20


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