フィルターのクリア

I'm trying to use Cantera function on matlab but it gives me back the same error:

25 ビュー (過去 30 日間)
giovanni bianco
giovanni bianco 2022 年 3 月 28 日
編集済み: Walter Roberson 2024 年 1 月 22 日
gas = IdealGasMix('gri30.yaml')
Warning: The function IdealGasMix is deprecated and will be removed after Cantera
2.5. Please use Solution as a replacement.
> In IdealGasMix (line 52)
Error using ThermoPhase (line 23)
***********************************************************************
XML_NoChild:
Error in XML file '' at line 0.
The XML Node <--> does not contain a required child node named <thermo>.
Existing children are named:
***********************************************************************
Error in Solution (line 50)
t = ThermoPhase(src, id);
Error in IdealGasMix (line 61)
s = Solution(infile);

回答 (1 件)

BhaTTa
BhaTTa 2024 年 1 月 22 日
Hey , I have noticed that the errors mention a deprecated function and a missing XML node. Based on that, here are a couple of things we could try:
1. Update the Function:
  • It seems like the function IdealGasMix is no longer recommended in Cantera. Would you be open to switching to the Solution function instead? It's designed to be a more reliable and up-to-date option for loading thermodynamic data.
2. Check the YAML File:
  • The second error points to a missing <thermo> node in the gri30.yaml file. It's crucial for defining thermodynamic properties. Would you mind double-checking the file path to ensure it's correct and that the file itself is a valid YAML file with the necessary node? If there's any chance it's corrupt or incomplete, we could try obtaining a fresh copy.
3. Update to Solution class:
  • Since IdealGasMix is deprecated, consider updating your code to use the Solution class instead. You can initialize it with the YAML file directly. Here's an example:
Corrected code
gas = Solution('gri30.yaml'); % Use the recommended function

カテゴリ

Help Center および File ExchangeThermodynamics and Heat Transfer についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by