CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Variable creation without Field Functions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2024, 10:34
Lightbulb Variable creation without Field Functions
  #1
New Member
 
Gilberto S.
Join Date: Nov 2023
Location: Brazil
Posts: 4
Rep Power: 2
Gilsuss is on a distinguished road
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.
Gilsuss is offline   Reply With Quote

Old   July 20, 2024, 02:52
Default
  #2
Member
 
Join Date: Jun 2014
Location: Turkey
Posts: 58
Rep Power: 12
koful is on a distinguished road
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.
koful is offline   Reply With Quote

Old   July 21, 2024, 00:27
Default
  #3
cwl
Senior Member
 
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 437
Rep Power: 18
cwl is on a distinguished road
Quote:
Originally Posted by Gilsuss View Post
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.
Could be done with Simulation Operations and storing values of time in Parameters.

Could also be done with Update Events triggering Reports/Monitors to store values of time.
cwl is offline   Reply With Quote

Old   July 22, 2024, 08:09
Default
  #4
New Member
 
Gilberto S.
Join Date: Nov 2023
Location: Brazil
Posts: 4
Rep Power: 2
Gilsuss is on a distinguished road
Quote:
Originally Posted by koful View Post
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.
What I mean is that Star-ccm+ can create parameters, but those parameters cannot update themselves alone without anything external of it, and also reports and field functions cannot update them.
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:
Originally Posted by cwl View Post
Could be done with Simulation Operations and storing values of time in Parameters.

Could also be done with Update Events triggering Reports/Monitors to store values of time.
I will try exploring a solution using Update Events, but I still haven't worked with it. Could you show me a path to follow? Maybe a good workflow to use?

Thank you in advance!
Gilsuss is offline   Reply With Quote

Old   August 20, 2024, 14:02
Default
  #5
New Member
 
Join Date: Oct 2023
Posts: 6
Rep Power: 2
Voluped is on a distinguished road
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.
Voluped is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 21:46.