Borrar filtros
Borrar filtros

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

25 visualizaciones (últimos 30 días)
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);

Respuestas (1)

BhaTTa
BhaTTa el 22 de En. de 2024
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

Categorías

Más información sobre Thermodynamics and Heat Transfer en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by