Welcome to the TRNSYS Users Forum.

The forum is a place where people can interact and have discussions about different topics involving the use of the TRNSYS software package. Here you can post topics for discussion or questions on using TRNSYS and get advice from other users or TRNSYS experts. This forum is not intended for detailed technical support. Users should contact their distributor’s hotline for such assistance.

Some tips for success on using the forum:

  • Follow the Forum Rules posted in Forum Administration.
  • There are categories for different types of topics and questions. Post your topic or question into the proper category.
  • Before posting a topic or question search the existing topics  (and the TRNSYS Users listserv archive or Post archive) to see if a similar topic or question has already been answered.
  • Use a descriptive topic name. Don’t use attention getting subjects, they don’t get attention and only annoy people.
  • State the version of TRNSYS and which add-ons your are using.
  • Include enough specific details for your topic of question to be answered. Just posting “Why am I getting an error?” without describing the specific error and what you are trying to do when you get the error will not receive a response that fixes your issue.
  • Remember when people help you, they are doing you a favor. Be patient, help people out by posting good descriptions of what you need help with, and be polite even if a response does not solve your issue.
  • Moderators may edit your post for clarity or move your topic to a more appropriate category.

Notifications
Clear all

Do you knwo how to solve an issue arising with multiple instances of a TYPE in the same simulation ?

2 Posts
2 Users
0 Reactions
58 Views
0
[#528]
Topic starter

Hello everyone,

I am modeling a building heating and cooling system in TRNSYS 18 coupled with a heat pump and two separate Phase Change Material (PCM) thermal energy storage tanks simulated using Type 840 (Heinz & Moser model):

  • Heating PCM tank (Type 840 – Unit 1): Filled with encapsulated cylinders of Crodatherm 37 (operating range: 35–45 °C), reading external heating/cooling enthalpy tables via Logical Units 30 and 33.

  • Cooling PCM tank (Type 840 – Unit 2): Filled with encapsulated cylinders of Crodatherm 9.5 (operating range: 5–12 °C), reading separate external enthalpy tables via different Logical Units.

I developed equations to control the operation of a heat pump, using a storage tank containing phase-change material (PCM) for the winter and a separate tank—also containing PCM—for the summer; both were modeled using the TYPE 840 component.

However, I noticed inconsistencies in the results regarding the PCM melting process—specifically, the energy released deviated from expectations, which in turn affected the final simulation results.

After spending a considerable amount of time investigating the potential causes, I discovered that when each circuit was run independently—whether for heating or cooling—the simulation results matched my expectations. I then removed one of the tanks (TYPE 840) from the simulation file (deck file) and confirmed that the issue stemmed precisely from the presence of two such tanks.

Could someone provide guidance on how to resolve this? While I could run the simulations separately, it would be significantly more time-consuming; therefore, if a solution exists, I would prefer to try that first. Thank you in advance for any comments or suggestions. I do appreciate it.

 

Regards

Humberto 


2 Answers
0

@humbertosantos thank you for the detailed post! Your independent testing of the circuits and identification that the issue only arises when two tanks are present indicates the issue is likely in the source code. My guess is that the temperature of the PCM is not being properly stored for calculations in the next time step. This would then lead to the two tanks (of the same TYPE) using temperatures interchangeably and producing unexplainable results.

The simplest fix if you have the source code and are familiar with recompiling types is to make a copy of Type 840 called Type 1840, replacing all "Type840" text in the source code with "Type1840" and recompiling it in the MyType project of TRNSYS18\Compilers\TRNSYS\TRNSYS.sln. You will also need to modify the Type 840 proforma to make a Type 1840 proforma. This will ensure that the two tanks do not share any variables since they will be treated as a different TYPE.

If you do not have the source code, you will need to reach out to the authors of the model to see if they can provide the source code or create and compile a Type 1840 for you. Alternatively, they may be able to identify the root issue and provide an updated Type 840 that works with multiple instances.

Finally, if the first two options are not possible then I would suggest you reach out to your distributor as they should be able to assist in recompiling the source code and troubleshooting.

 

cheers,

John


0
Topic starter

Hello John

@JohnSteinbergs thank you for your comment.

Your comment regarding the coding issue of variable storage is consistent with the answers I have by now. I found a 2007 thread in what seems to be a Trnsys obselete forum where someone was having the same problem. So you mentioned the temperature variable that is not being properly stored, which makes sense.

I reached out to the TYPE developers and they recognized the issue some time ago, maybe in the next version it will be fixed. However, they also gave me a solution to overcome this problem easily. In addition, I was developing my own solution to this problem. I will list them here aiming to help others in the future.

Solution #1: The easiest way to fix this problem and was recommended by the type developers. Since the tank storage can hold up to three different PCM modules, use different modules to include PCM information. For example, in my case study there are two tanks, one for the heating season and another for the cooling season. When setting the data, I include the hot tank PCM in module 1, and for the cold tank the PCM goes in module 2. I had the PCMs using the module 1 of each corresponding tank. This definitely solved the problem, as the problematic variable is stored in different locations for each PCM module. However, it may be more complicated if more than three tanks are intended to be used.

Solution #2: As suggested by John Steinbergs in the comment above and by David here Re: [TRNSYS-users] Problems using several types in a project. This seems to be an effective way to solve the problem, but needs a bit of skills with recompiling. As you have said, the fortran files will be needed, and hopefully one can reach out to the developer.

Solution #3: prior to the TYPE840 developers answered my email, I was creating my own way to overcome the problem by implementing binary variables. In this regard, I have a one tank only with the parameters set as variable name, which allowed to call the parameters through the calculator. Each parameter will be called whenever the season signal is on. As I have two main season signals, one for winter and another for summer, that would be another way to overcome the issue.

Thank you again for the comment and hope that these conversations here can help others in the future.

Kind regards

Humberto

 


Share: