Opened 7 years ago

Closed 7 years ago

#4179 closed defect (worksforme)

compilation error when using multiple media

Reported by: Ulfsen Owned by: somebody
Priority: high Milestone: Future
Component: *unknown* Version: v1.12.0
Keywords: Cc:

Description

Hi,

I just tested the development version v1.12.0 with a simple model of a gas-water heat exchanger, which is working in Version 1.9.7. I simplified the model to the following test-code:

model simple_BasicHX_water_gas
  package Medium1 = Modelica.Media.IdealGases.SingleGases.N2;
  package Medium2 = Modelica.Media.Water.ConstantPropertyLiquidWater;
end simple_BasicHX_water_gas;

Can't be compiled and give the errors:

C:/OpenModelica1.9.7//share/omc/scripts/Compile.bat TCV.Plant.simple_BasicHX_water_gas gcc mingw64 parallel 4 0
PATH = "C:\OpenModelica1.9.7\MinGW\bin;C:\OpenModelica1.9.7\MinGW\bin\..\libexec\gcc\mingw32\4.4.0\;"
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.9.7//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas.o TCV.Plant.simple_BasicHX_water_gas.c
In file included from TCV.Plant.simple_BasicHX_water_gas.c:2:
TCV.Plant.simple_BasicHX_water_gas_model.h:70: error: expected declaration specifiers or '...' before 'DAEMODE_DATA'
TCV.Plant.simple_BasicHX_water_gas.c:132: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:141: warning: initialization makes integer from pointer without a cast
TCV.Plant.simple_BasicHX_water_gas.c:148: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:149: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:150: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:151: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:152: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:153: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:154: warning: initialization makes integer from pointer without a cast
TCV.Plant.simple_BasicHX_water_gas.c:155: warning: initialization makes integer from pointer without a cast
TCV.Plant.simple_BasicHX_water_gas.c:158: warning: initialization makes pointer from integer without a cast
TCV.Plant.simple_BasicHX_water_gas.c:159: warning: initialization makes pointer from integer without a cast
TCV.Plant.simple_BasicHX_water_gas.c:166: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:167: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:168: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:169: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:170: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:171: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:172: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:173: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:174: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:175: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:176: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:177: warning: initialization from incompatible pointer type
TCV.Plant.simple_BasicHX_water_gas.c:178: warning: excess elements in struct initializer
TCV.Plant.simple_BasicHX_water_gas.c:178: warning: (near initialization for 'TCV_Plant_simple_BasicHX_water_gas_callback')
TCV.Plant.simple_BasicHX_water_gas.c:184: warning: excess elements in struct initializer
TCV.Plant.simple_BasicHX_water_gas.c:184: warning: (near initialization for 'TCV_Plant_simple_BasicHX_water_gas_callback')
TCV.Plant.simple_BasicHX_water_gas.c:187: warning: excess elements in struct initializer
TCV.Plant.simple_BasicHX_water_gas.c:187: warning: (near initialization for 'TCV_Plant_simple_BasicHX_water_gas_callback')
TCV.Plant.simple_BasicHX_water_gas.c: In function 'TCV_Plant_simple_BasicHX_water_gas_setupDataStruc':
TCV.Plant.simple_BasicHX_water_gas.c:266: error: 'MODEL_DATA' has no member named 'nSensitivityVars'
TCV.Plant.simple_BasicHX_water_gas.c:267: error: 'MODEL_DATA' has no member named 'nSensitivityParamVars'
TCV.Plant.simple_BasicHX_water_gas.c: In function 'main':
TCV.Plant.simple_BasicHX_water_gas.c:295: error: 'compiledInDAEMode' undeclared (first use in this function)
TCV.Plant.simple_BasicHX_water_gas.c:295: error: (Each undeclared identifier is reported only once
TCV.Plant.simple_BasicHX_water_gas.c:295: error: for each function it appears in.)
\MinGW\bin\mingw32-make: * [TCV.Plant.simple_BasicHX_water_gas.o] Error 1
Compilation process failed. Exited with code 2.

Change History (5)

comment:1 Changed 7 years ago by adrpo

The errors you're giving seem to be generated by a 1.9.7 installation (the directory names are pointing to it), but you said it was working with 1.9.7 and you are now you're using 1.12.
The environment variable OPENMODELICAHOME and OPENMODELICALIBRARY should point to 1.12 not 1.9.7.

comment:2 Changed 7 years ago by adrpo

The compilation for this model works fine for me with 1.12:

c:/home/adrpo33/dev/OpenModelica/build/share/omc/scripts/Compile.bat simple_BasicHX_water_gas gcc mingw64 parallel 8 0
PATH = "C:\OMDev\tools\msys\mingw64\bin;C:\OMDev\tools\msys\mingw64\bin\..\..\usr\bin;"
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas.o simple_BasicHX_water_gas.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_functions.o simple_BasicHX_water_gas_functions.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_records.o simple_BasicHX_water_gas_records.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_01exo.o simple_BasicHX_water_gas_01exo.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_02nls.o simple_BasicHX_water_gas_02nls.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_03lsy.o simple_BasicHX_water_gas_03lsy.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_04set.o simple_BasicHX_water_gas_04set.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_05evt.o simple_BasicHX_water_gas_05evt.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_06inz.o simple_BasicHX_water_gas_06inz.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_07dly.o simple_BasicHX_water_gas_07dly.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_08bnd.o simple_BasicHX_water_gas_08bnd.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_09alg.o simple_BasicHX_water_gas_09alg.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_10asr.o simple_BasicHX_water_gas_10asr.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_11mix.o simple_BasicHX_water_gas_11mix.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_12jac.o simple_BasicHX_water_gas_12jac.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_13opt.o simple_BasicHX_water_gas_13opt.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_14lnz.o simple_BasicHX_water_gas_14lnz.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_15syn.o simple_BasicHX_water_gas_15syn.c
gcc    -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o simple_BasicHX_water_gas_16dae.o simple_BasicHX_water_gas_16dae.c
gcc -I. -o simple_BasicHX_water_gas.exe simple_BasicHX_water_gas.o simple_BasicHX_water_gas_functions.o simple_BasicHX_water_gas_records.o simple_BasicHX_water_gas_01exo.o simple_BasicHX_water_gas_02nls.o simple_BasicHX_water_gas_03lsy.o simple_BasicHX_water_gas_04set.o simple_BasicHX_water_gas_05evt.o simple_BasicHX_water_gas_06inz.o simple_BasicHX_water_gas_07dly.o simple_BasicHX_water_gas_08bnd.o simple_BasicHX_water_gas_09alg.o simple_BasicHX_water_gas_10asr.o simple_BasicHX_water_gas_11mix.o simple_BasicHX_water_gas_12jac.o simple_BasicHX_water_gas_13opt.o simple_BasicHX_water_gas_14lnz.o simple_BasicHX_water_gas_15syn.o simple_BasicHX_water_gas_16dae.o -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/home/adrpo33/dev/OMTesting/bugs/4179"      -falign-functions -msse2 -mfpmath=sse      -I"c:/home/adrpo33/dev/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=0 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -L"C:/home/adrpo33/dev/OMTesting/bugs/4179" -L"c:/home/adrpo33/dev/OpenModelica/build/lib//omc" -L"c:/home/adrpo33/dev/OpenModelica/build/lib" -Wl,--stack,16777216,-rpath,"c:/home/adrpo33/dev/OpenModelica/build/lib//omc" -Wl,-rpath,"c:/home/adrpo33/dev/OpenModelica/build/lib"   -lregex -lexpat -lomcgc -lpthread -fopenmp -loleaut32 -lz -lhdf5  -lSimulationRuntimeC -lomcgc -lexpat -lregex -static-libgcc -luuid -loleaut32 -lole32 -lws2_32 -llis -lumfpack -lklu -lcolamd -lbtf -lamd -lsundials_idas -lsundials_kinsol -lsundials_nvecserial -lipopt -lcoinmumps -lpthread -lm -lgfortranbegin -lgfortran -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lopenblas -lcminpack -lwsock32 -lstdc++ 
Compilation process finished successfully.

I guess you're somehow mixing 1.9.7 installation with 1.12 installation.

comment:3 Changed 7 years ago by anonymous

Yes, you're right. I mixed the installation for testing purposes and now this error is gone. Sorry for the misleading question. But when I try to model the original heat exchanger (before the wrongly reduction due to the above simple model):

model simple_BasicHX_water_gas
  import SI = Modelica.SIunits;
  parameter SI.AbsolutePressure p_start = 101325 "Initial value of pressure";
  parameter SI.Temperature T_start = 293.15 "Initial value of temperature";
  parameter Modelica.Fluid.Types.ModelStructure pipeModelStructure = Modelica.Fluid.Types.ModelStructure.a_v_b;
  package Medium1 = Modelica.Media.IdealGases.SingleGases.N2;
  package Medium2 = Modelica.Media.Water.ConstantPropertyLiquidWater "Medium model";
  inner Modelica.Fluid.System system(T_ambient = T_start, p_ambient = p_start, m_flow_small = 1e-6, momentumDynamics = Modelica.Fluid.Types.Dynamics.DynamicFreeInitial, energyDynamics = Modelica.Fluid.Types.Dynamics.DynamicFreeInitial, massDynamics = Modelica.Fluid.Types.Dynamics.DynamicFreeInitial) annotation(Placement(transformation(extent = {{-90, 70}, {-70, 90}})));

  Modelica.Fluid.Sources.MassFlowSource_T Ambient_in(redeclare package Medium = Medium1, T = 273.15 + 80, nPorts = 1, use_m_flow_in = true) annotation(Placement(visible = true, transformation(origin = {-24, -52}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));

  Modelica.Fluid.Sources.Boundary_pT Ambient_out(redeclare package Medium = Medium1, T = 273.15 + 80, nPorts = 1, p = p_start) annotation(Placement(visible = true, transformation(origin = {-24, 12}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));

  Modelica.Fluid.Sources.Boundary_pT Ambient2_out(redeclare package Medium = Medium2, T = T_start, nPorts = 1, p = p_start) annotation(Placement(visible = true, transformation(origin = {-72, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

  Modelica.Fluid.Sources.MassFlowSource_T Ambient2_in(redeclare package Medium = Medium2, T = T_start, nPorts = 1, use_m_flow_in = true) annotation(Placement(visible = true, transformation(origin = {16, -4}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

  Modelica.Blocks.Sources.RealExpression ramp_m_dot1(y = 0 + 1 / 2 * (Modelica.Math.tanh(2 * 1 * (time - 60)) + 1) * 1) annotation(Placement(visible = true, transformation(origin = {-44, -76}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));

  Modelica.Blocks.Sources.RealExpression ramp_m_dot2(y = 0 + 1 / 2 * (Modelica.Math.tanh(2 * 1 * (time - 60)) + 1) * 1) annotation(Placement(visible = true, transformation(origin = {44, 0}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));

  Modelica.Fluid.Examples.HeatExchanger.BaseClasses.BasicHX WT_Nachreformer(redeclare package Medium_1 = Medium1, redeclare package Medium_2 = Medium2, redeclare model HeatTransfer_1 = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.LocalPipeFlowHeatTransfer, redeclare model HeatTransfer_2 = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.LocalPipeFlowHeatTransfer, redeclare model FlowModel_1 = Modelica.Fluid.Pipes.BaseClasses.FlowModels.DetailedPipeFlow, redeclare model FlowModel_2 = Modelica.Fluid.Pipes.BaseClasses.FlowModels.DetailedPipeFlow, T_start_1 = T_start, T_start_2 = T_start, Twall_start = T_start, area_h_1 = 1, area_h_2 = 1, c_wall = 477, crossArea_1 = 0.1, crossArea_2 = 0.01, dT = 0, k_wall = 15, length = 1, m_flow_start_1 = 0, m_flow_start_2 = 0, modelStructure_1 = pipeModelStructure, modelStructure_2 = pipeModelStructure, nNodes = 5, p_a_start1 = p_start, p_a_start2 = p_start, p_b_start1 = p_start, p_b_start2 = p_start, perimeter_1 = 0.3, perimeter_2 = 0.3, rho_wall(displayUnit = "kg/m3") = 8000, s_wall = 0.003) annotation(Placement(visible = true, transformation(origin = {-24, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
initial equation

equation
      connect(WT_Nachreformer.port_b2, Ambient2_out.ports[1]) annotation(Line(points = {{-28, -30}, {-28, -30}, {-28, -36}, {-62, -36}, {-62, -36}}, color = {0, 127, 255}));
      connect(Ambient2_in.ports[1], WT_Nachreformer.port_a2) annotation(Line(points = {{6, -4}, {-20, -4}, {-20, -8}, {-20, -8}}, color = {0, 127, 255}));
  connect(ramp_m_dot2.y, Ambient2_in.m_flow_in) annotation(Line(points = {{50.6, 0}, {39.3, 0}, {39.3, 4}, {26, 4}}, color = {0, 0, 127}));
  connect(ramp_m_dot1.y, Ambient_in.m_flow_in) annotation(Line(points = {{-38, -76}, {-32, -76}, {-32, -62}, {-32, -62}}, color = {0, 0, 127}));
  connect(WT_Nachreformer.port_b1, Ambient_out.ports[1]) annotation(Line(points = {{-24, -12}, {-24, -12}, {-24, 2}, {-24, 2}}, color = {0, 127, 255}));
  connect(Ambient_in.ports[1], WT_Nachreformer.port_a1) annotation(Line(points = {{-24, -42}, {-24, -42}, {-24, -28}, {-24, -28}}, color = {0, 127, 255}));
  annotation(Documentation(info = "<html>

</html>"), experiment(StopTime = 200, StartTime = 0, Tolerance = 1e-5, Interval = 0.2), __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS"));
end simple_BasicHX_water_gas;

I get the following compilation error (now the correct output with the nightly-build):

C:/OpenModelica1.12.0-dev-64bit//share/omc/scripts/Compile.bat TCV.Plant.simple_BasicHX_water_gas gcc mingw64 parallel 4 0
PATH = "C:\OpenModelica1.12.0-dev-64bit\tools\msys\mingw64\bin;C:\OpenModelica1.12.0-dev-64bit\tools\msys\mingw64\bin\..\..\usr\bin;"
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.12.0-dev-64bit//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=30 -DOMC_NUM_NONLINEAR_SYSTEMS=21 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas.o TCV.Plant.simple_BasicHX_water_gas.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.12.0-dev-64bit//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=30 -DOMC_NUM_NONLINEAR_SYSTEMS=21 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas_functions.o TCV.Plant.simple_BasicHX_water_gas_functions.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.12.0-dev-64bit//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=30 -DOMC_NUM_NONLINEAR_SYSTEMS=21 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas_records.o TCV.Plant.simple_BasicHX_water_gas_records.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.12.0-dev-64bit//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=30 -DOMC_NUM_NONLINEAR_SYSTEMS=21 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas_01exo.o TCV.Plant.simple_BasicHX_water_gas_01exo.c
gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.12.0-dev-64bit//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=30 -DOMC_NUM_NONLINEAR_SYSTEMS=21 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas_02nls.o TCV.Plant.simple_BasicHX_water_gas_02nls.c
TCV.Plant.simple_BasicHX_water_gas.c: In function 'TCV_Plant_simple_BasicHX_water_gas_eqFunction_2078':
TCV.Plant.simple_BasicHX_water_gas.c:5074:104: error: too few arguments to function 'omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity'

data->localData[0]->realVars[569] /* WT_Nachreformer._pipe_2._heatTransfer._lambdas[1] variable */ = omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData, omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState(threadData, data->localData[0]->realVars[624] /* WT_Nachreformer._pipe_2._mediums[1]._p DUMMY_STATE */, data->localData[0]->realVars[15] /* WT_Nachreformer._pipe_2._mediums[1]._T STATE(1) */));


In file included from TCV.Plant.simple_BasicHX_water_gas_model.h:18:0,

from TCV.Plant.simple_BasicHX_water_gas.c:2:

TCV.Plant.simple_BasicHX_water_gas_functions.h:867:15: note: declared here

modelica_real omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData_t *threadData, Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState _state, modelica_integer _method);


TCV.Plant.simple_BasicHX_water_gas.c: In function 'TCV_Plant_simple_BasicHX_water_gas_eqFunction_2098':
TCV.Plant.simple_BasicHX_water_gas.c:5536:104: error: too few arguments to function 'omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity'

data->localData[0]->realVars[570] /* WT_Nachreformer._pipe_2._heatTransfer._lambdas[2] variable */ = omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData, omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState(threadData, data->localData[0]->realVars[625] /* WT_Nachreformer._pipe_2._mediums[2]._p DUMMY_STATE */, data->localData[0]->realVars[16] /* WT_Nachreformer._pipe_2._mediums[2]._T STATE(1) */));


In file included from TCV.Plant.simple_BasicHX_water_gas_model.h:18:0,

from TCV.Plant.simple_BasicHX_water_gas.c:2:

TCV.Plant.simple_BasicHX_water_gas_functions.h:867:15: note: declared here

modelica_real omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData_t *threadData, Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState _state, modelica_integer _method);


TCV.Plant.simple_BasicHX_water_gas.c: In function 'TCV_Plant_simple_BasicHX_water_gas_eqFunction_2119':
TCV.Plant.simple_BasicHX_water_gas.c:6010:104: error: too few arguments to function 'omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity'

data->localData[0]->realVars[571] /* WT_Nachreformer._pipe_2._heatTransfer._lambdas[3] variable */ = omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData, omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState(threadData, data->localData[0]->realVars[626] /* WT_Nachreformer._pipe_2._mediums[3]._p DUMMY_STATE */, data->localData[0]->realVars[17] /* WT_Nachreformer._pipe_2._mediums[3]._T STATE(1) */));


In file included from TCV.Plant.simple_BasicHX_water_gas_model.h:18:0,

from TCV.Plant.simple_BasicHX_water_gas.c:2:

TCV.Plant.simple_BasicHX_water_gas_functions.h:867:15: note: declared here

modelica_real omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData_t *threadData, Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState _state, modelica_integer _method);


TCV.Plant.simple_BasicHX_water_gas.c: In function 'TCV_Plant_simple_BasicHX_water_gas_eqFunction_2141':
TCV.Plant.simple_BasicHX_water_gas.c:6604:104: error: too few arguments to function 'omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity'

data->localData[0]->realVars[572] /* WT_Nachreformer._pipe_2._heatTransfer._lambdas[4] variable */ = omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData, omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState(threadData, data->localData[0]->realVars[627] /* WT_Nachreformer._pipe_2._mediums[4]._p DUMMY_STATE */, data->localData[0]->realVars[18] /* WT_Nachreformer._pipe_2._mediums[4]._T STATE(1) */));


In file included from TCV.Plant.simple_BasicHX_water_gas_model.h:18:0,

from TCV.Plant.simple_BasicHX_water_gas.c:2:

TCV.Plant.simple_BasicHX_water_gas_functions.h:867:15: note: declared here

modelica_real omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData_t *threadData, Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState _state, modelica_integer _method);


TCV.Plant.simple_BasicHX_water_gas.c: In function 'TCV_Plant_simple_BasicHX_water_gas_eqFunction_2162':
TCV.Plant.simple_BasicHX_water_gas.c:7078:104: error: too few arguments to function 'omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity'

data->localData[0]->realVars[573] /* WT_Nachreformer._pipe_2._heatTransfer._lambdas[5] variable */ = omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData, omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState(threadData, data->localData[0]->realVars[628] /* WT_Nachreformer._pipe_2._mediums[5]._p DUMMY_STATE */, data->localData[0]->realVars[19] /* WT_Nachreformer._pipe_2._mediums[5]._T STATE(1) */));


In file included from TCV.Plant.simple_BasicHX_water_gas_model.h:18:0,

from TCV.Plant.simple_BasicHX_water_gas.c:2:

TCV.Plant.simple_BasicHX_water_gas_functions.h:867:15: note: declared here

modelica_real omc_Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_thermalConductivity(threadData_t *threadData, Modelica_Fluid_Pipes_BaseClasses_HeatTransfer_Medium_ThermodynamicState _state, modelica_integer _method);


gcc -falign-functions -msse2 -mfpmath=sse -I"C:/OpenModelica1.12.0-dev-64bit//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=TCV_Plant_simple_BasicHX_water_gas -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=30 -DOMC_NUM_NONLINEAR_SYSTEMS=21 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0 -c -o TCV.Plant.simple_BasicHX_water_gas_03lsy.o TCV.Plant.simple_BasicHX_water_gas_03lsy.c
<builtin>: recipe for target 'TCV.Plant.simple_BasicHX_water_gas.o' failed
\tools\msys\mingw64\bin\mingw32-make: * [TCV.Plant.simple_BasicHX_water_gas.o] Error 1
\tools\msys\mingw64\bin\mingw32-make:
* Waiting for unfinished jobs....
TCV.Plant.simple_BasicHX_water_gas_02nls.c: In function 'TCV_Plant_simple_BasicHX_water_gas_initialNonLinearSystem':
TCV.Plant.simple_BasicHX_water_gas_02nls.c:2528:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[0].getIterationVars = getIterationVarsNLS532;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2541:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[1].getIterationVars = getIterationVarsNLS551;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2554:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[2].getIterationVars = getIterationVarsNLS562;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2567:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[3].getIterationVars = getIterationVarsNLS573;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2580:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[4].getIterationVars = getIterationVarsNLS584;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2593:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[5].getIterationVars = getIterationVarsNLS598;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2606:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[6].getIterationVars = getIterationVarsNLS604;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2618:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[7].getIterationVars = getIterationVarsNLS1586;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2631:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[8].getIterationVars = getIterationVarsNLS1605;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2644:43: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[9].getIterationVars = getIterationVarsNLS1616;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2657:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[10].getIterationVars = getIterationVarsNLS1627;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2670:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[11].getIterationVars = getIterationVarsNLS1638;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2683:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[12].getIterationVars = getIterationVarsNLS1652;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2696:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[13].getIterationVars = getIterationVarsNLS1658;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2708:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[14].getIterationVars = getIterationVarsNLS1903;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2721:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[15].getIterationVars = getIterationVarsNLS1933;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2734:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[16].getIterationVars = getIterationVarsNLS1963;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2747:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[17].getIterationVars = getIterationVarsNLS1976;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2760:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[18].getIterationVars = getIterationVarsNLS2025;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2773:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[19].getIterationVars = getIterationVarsNLS2031;


TCV.Plant.simple_BasicHX_water_gas_02nls.c:2786:44: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

nonLinearSystemData[20].getIterationVars = getIterationVarsNLS2209;


Compilation process failed. Exited with code 2.

comment:4 Changed 7 years ago by anonymous

This error is still existing - even in the newly released Version 1.11 - under Windows (64bit) and Linux

I further investigated this error and found out, that there is some errors occur while flattening. Simply test the above model and compare the flat outputs from 1.9.7 and 1.11.

Could somebody check what's going on? Does anybody have made simulations with two pipes and two different media?

comment:5 Changed 7 years ago by casella

  • Resolution set to worksforme
  • Status changed from new to closed

I tried it with OpenModelica-v1.13.0-dev-63-g453e1c7-64bit, the model was translated and simulated without problems.

Note: See TracTickets for help on using tickets.