Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

problem with partial models

problem with partial models

Hello Community,

This is my first post here. I am a student and am trying to get the Modelica WasteWater Library working for Openmodelica.

My Problem: Everytime when I am useing a partial model or partial block and try to ckeck the model it gives an Error saying "No viable alternativ near token:"
So is there something you need to add to the partial model that you did not need with dymola?

Thanks
Pliskin

Re: problem with partial models

for example when i write:

partial model WasteWater.ASM1.Interfaces.ASM1base
  "Base class of WWTP modelling by ASM1"
  extends Interfaces.stoichiometry;
  package WWU = WasteWater.WasteWaterUnits;
 
  // parameters based on the original ASM1 publication based on 15 deg C   
  Real mu_h "Maximum heterotrophic growth rate f(T) [day^-1]";
  Real b_h "Heterotrophic decay rate f(T) [day^-1]";
  Real mu_a "Maximum autotrophic growth rate f(T) [day^-1]";
  //Real K_nh "Half-saturation (auto. growth) f(T) [g NH-N/m3]";
  Real b_a "Autotrophic decay rate f(T) [day^-1]";
  Real k_a "Ammonification rate f(T) [m3/(g COD day)]";
  Real k_h "Maximum specific hydrolysis rate f(T) [g Xs/(g Xbh COD day)]";
  Real K_x "Half-saturation (hydrolysis) f(T) [g Xs/(g Xbh COD)]";
  parameter Real mu_h_T=4.0
    "Maximum heterotrophic growth rate at T=15 deg C [day^-1]";
  parameter Real b_h_T=0.28 "Heterotrophic decay rate at T=15 deg C [day^-1]";
  parameter Real mu_a_T=0.5
    "Maximum autotrophic growth rate at T=15 deg C[day^-1]";
  parameter Real b_a_T=0.1 "Autotrophic decay rate at T=15 deg C [day^-1]";
  parameter Real k_a_T=0.06
    "Ammonification rate at T=15 deg C [m3/(g COD day)]";
  parameter Real k_h_T=1.75
    "Maximum specific hydrolysis rate at T=15 deg C [g Xs/(g Xbh COD day)]";
  parameter Real K_x_T=0.0175
.
.
.
.
 
  // Outputs
 
  Out.Q + In.Q = 0;
  Out.Si = Si;
  Out.Ss = Ss;
  Out.Xi = Xi;
  Out.Xs = Xs;
  Out.Xbh = Xbh;
  Out.Xba = Xba;
  Out.Xp = Xp;
  Out.So = So;
  Out.Sno = Sno;
  Out.Snh = Snh;
  Out.Snd = Snd;
  Out.Xnd = Xnd;
  Out.Salk = Salk;
 
  MeasurePort.Si = Si;
  MeasurePort.Ss = Ss;
  MeasurePort.Xi = Xi;
  MeasurePort.Xs = Xs;
  MeasurePort.Xbh = Xbh;
  MeasurePort.Xba = Xba;
  MeasurePort.Xp = Xp;
  MeasurePort.So = So;
  MeasurePort.Sno = Sno;
  MeasurePort.Snh = Snh;
  MeasurePort.Snd = Snd;
  MeasurePort.Xnd = Xnd;
  MeasurePort.Salk = Salk;
 
end ASM1base;



and I check it. It will say :
Syntax    14:30:47        32:3-33:2    No viable alternative near token: Base class of WWTP modelling by ASM1

Re: problem with partial models

It's because you have dots in your model name, i.e. WasteWater.ASM1.Interfaces.ASM1base, which is not allowed in Modelica. Either rename the model to something without dots, or enclose the name in single quotes. See the definition of IDENT in appendix B of the Modelica specification for more details on valid characters in model names.

Re: problem with partial models

There is indeed a syntax error in your code.

You are supposed to write:

Code:

within WasteWater.ASM1.Interfaces;

partial model ASM1base
  // ...

Re: problem with partial models

Thanks for the Help!

At least that Problem ist gone. More to come!

There are 0 guests and 0 other users also viewing this topic