필터 지우기
필터 지우기

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

조회 수: 25 (최근 30일)
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 CenterFile Exchange에서 Thermodynamics 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