Is there a way to switch between two thermal branches in a simscape model?

11 visualizaciones (últimos 30 días)
Hi,
I'm trying to model a heat transfer scenario, during the initial transient state, there is convective heat transfer in the system and afterwards evaporative heat transfer occurs.
I've defined both these scenarios using simscape blocks, however, I want to modify the model so that the latter occurs at the saturation temperature. Hence the need to monitor the output temperature and switch the model from a convective heat transfer system to a evaporative heat transfer system.
Is there a particular block that could possibly be used for this, or is it possible to create a switch block (similar to electrical) for the thermal domain as well?
Any advice is much apprciated.
Thanks
Del

Respuesta aceptada

Jack
Jack el 29 de Mzo. de 2023
Yes, it is possible to create a switch block for the thermal domain in Simulink/Simscape. One way to implement this is to use a combination of Simulink and MATLAB functions.
Here's a high-level overview of how you could approach this:
  1. In Simulink, use a temperature sensor block to measure the temperature output from the convective heat transfer system.
  2. Use a MATLAB Function block to compare the measured temperature to the saturation temperature, and output a boolean value indicating whether or not the saturation temperature has been reached.
  3. Use the boolean output from the MATLAB Function block to switch between the convective and evaporative heat transfer systems using a Switch block.
  4. In the evaporative heat transfer system, use a saturation pressure block to calculate the saturation pressure at the current temperature.
  5. Use this saturation pressure value in a Pressure Transducer block to measure the pressure at the evaporative heat transfer surface.
  6. Use this pressure value to calculate the evaporation rate using a MATLAB Function block.
Note that the specifics of your model may vary depending on the exact scenario you're modeling, but this general approach should work for most cases.
I hope this helps! Let me know if you have any further questions.
  3 comentarios
Jack
Jack el 30 de Mzo. de 2023
  1. Input signal size: If your temperature sensor outputs a [1 x 1] signal (time and temperature), you can use a "Selector" block in Simulink to extract the temperature value and pass it to the input of your function block. The Selector block allows you to select a specific element or range of elements from an input signal. In your case, you would select the second element (the temperature value) of the [1 x 1] signal.
  2. Undefined variables: If you are getting an error related to undefined variables, it could be because the Simulink model is not able to access the variables defined in your workspace. To make the variables accessible to the Simulink model, you can use the "From Workspace" block in Simulink. The From Workspace block allows you to import data from the MATLAB workspace into the Simulink model. You can connect this block to the input of your function block to provide the necessary input data. Make sure that the variable names in the From Workspace block match the variable names defined in your workspace.
Regarding linking the function block to the workspace, you do not need to link the block to the workspace explicitly. Simulink automatically looks for variables with the same name in the workspace and uses them as input signals. However, you may need to adjust the variable scope and access settings to ensure that the Simulink model can access the variables.
I hope this helps! Let me know if you have any further questions or if you need additional assistance with your Simulink model.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Foundation and Custom Domains en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by