|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Gilberto S.
Join Date: Nov 2023
Location: Brazil
Posts: 4
Rep Power: 2 ![]() |
Hi All,
I am currently running a simulation case where I need to create a variable to let me turn on or off a heat source. Basically, I have a preditive function where it tells the heat source to turn on or off, but after the function says to the heat source to turn off, it needs to wait more t_limit time before turning off. Basically: 1. Heat_Status=On && Heat_Source=On 2. Predictive_function turns Heat_Status=Off 3. Heat_Source=On for more t_limit time 4. Heat_Status=Off && Heat_Source=Off These 2 field functions, Heat_Status and Heat_Source, are not exclusively time dependent, but also depend on other parameters, like the temperature on the sensor. The problem here is on the t_limit. I need some way to create this delay for turning it off. I've thought about creating a variable for this case, but Star-ccm+ doesn't have variable creation options, only field functions, and in this case I would need to count the time after the Heat_Status funtion is turned off. Would you have any ideas for this case? Is there a way to create variables inside the software? Or maybe a way around this problem? Anyways, thank you for your time and patience. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Join Date: Jun 2014
Location: Turkey
Posts: 58
Rep Power: 12 ![]() |
Hi,
If I understand correctly, you want to add a signal delay to heat source. What do you mean star can not create variable? It should be. Under the parameters folder you can create a delta time variable. Also at reports, you can create a simulation time report and add it to your function with adding a delta_time. |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 437
Rep Power: 18 ![]() |
Quote:
Could also be done with Update Events triggering Reports/Monitors to store values of time. |
||
![]() |
![]() |
![]() |
![]() |
#4 | ||
New Member
Gilberto S.
Join Date: Nov 2023
Location: Brazil
Posts: 4
Rep Power: 2 ![]() |
Quote:
I could also do the time tracking with reports, but if the heat source needs to be turned on and off continuously, the solution with reports will also not work. The question that I have here is what external mechanisms I could use for storing this time information! ![]() Quote:
Thank you in advance! |
|||
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Join Date: Oct 2023
Posts: 6
Rep Power: 2 ![]() |
Create Field Functions:
Heat_Status: This function determines whether the heat source should be on or off based on the predictive function and sensor temperature. Heat_Source: This function will incorporate the delay mechanism. Define Heat_Status: Create a field function (e.g., Heat_Status) that determines whether the heat source should be on or off based on the predictive function and sensor temperature. Define a Time-Dependent Heat_Source: Create a field function for Heat_Source that will use the value of Heat_Status and incorporate the delay mechanism. You can use a combination of logical conditions and a time-dependent field function. Example Implementation: // Define an initial state for the heat source initialHeatSource = 1; // Assume the heat source starts as on // Define the delay time (t_limit) t_limit = 10; // Replace with your desired delay time // Define the Heat_Status field function Heat_Status = ... // Your predictive function based on sensor temperature // Define the time-dependent Heat_Source field function Heat_Source = if(Heat_Status == 0, if(time - switchOffTime < t_limit, 1, 0), 1); // Define the switchOffTime field function to capture the time when Heat_Status turns off switchOffTime = if(Heat_Status == 0 && previousHeatStatus == 1, time, switchOffTime); // Define the previousHeatStatus field function to keep track of the Heat_Status in the previous time step previousHeatStatus = Heat_Status; Implement the Field Functions: Go to Tools > Field Functions and create the necessary field functions using the expressions provided above. Ensure the Heat_Source field function correctly references the delay logic. Apply the Field Functions: Assign the Heat_Source field function to control the heat source in your simulation setup. |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using surface integrals in custom field functions. | henvic | FLUENT | 0 | March 17, 2018 07:09 |
How to calculate pressure forces using custom field functions? | tsagaro | FLUENT | 7 | June 23, 2017 15:45 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 04:35 |
Dynamic Gradient Adaption: Mulitple Field Variable | Steve | FLUENT | 0 | July 12, 2005 17:36 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 20:09 |