Adrian Pop <[EMAIL PROTECTED]> writes:

Hi,

> This command actually works but it takes
> a lot of time (~34 minutes on my computer).
>> simulate(Idiot.Test,stopTime=6000/60,numberOfIntervals=20)

Oooh I see, I never had the patience 8-)

> I will need to have a look at this, but as far as
> I can see, the solver takes extremely small steps,
> that's why it takes a lot of time to run the
> simulation.

Strangely, it helps removing numberOfIntervals!

Good luck

     Dieter

>
> Cheers,
> Adrian Pop/
>
> dieter wrote:
>> Hi,
>>
>> when I run the small model below with:
>>
>> simulate(Idiot.Test,stopTime=5000/60,numberOfIntervals=20)
>>
>> it produces a result file.  But when I run it with:
>>
>> simulate(Idiot.Test,stopTime=6000/60,numberOfIntervals=20)
>>
>> the executable seems to stick in an infinite loop.
>>
>> I hope somebody can have a look at it or has some idea.
>>
>> Thanks
>>         Dieter
>>
>> ------------------------------------------------------------
>> package Idiot
>> //import Modelica.Constants.*;
>>
>> final constant Real pi = 3.1415926;
>> final constant Real ambientPressure = 101325;
>>
>> connector Port
>>   Real pressure;
>>   flow Real flowrate;
>> end Port;
>>  class Fluid                 "Water is the default"   parameter
>> Real density = 1e3;
>>   parameter Real viscosity = 1e-3;
>> end Fluid;  
>>
>> partial model TwoPorts
>>   outer parameter Fluid fluid;
>>   Port inPort, outPort;
>> equation
>>   inPort.flowrate + outPort.flowrate = 0;
>> end TwoPorts;
>>
>> partial model Conduit                "generic flow resistance element"
>>   extends TwoPorts;
>>   parameter Real referenceDiameter = 8e-3 "may it be the in or
>> outPort diameter"; //protected
>>   final parameter Real d = referenceDiameter; // final excludes them from 
>> the GUI
>>   final parameter Real A = pi/4 * d^2;
>>   Real dp                    "pressure loss";
>>   Real r,m, q, z;
>>   Real lossFactor;
>>   Real v                     "velocity";
>>   Real Re                    "Reynolds No";
>> equation
>>   r = fluid.density;
>>   m = fluid.viscosity;
>>   q = inPort.flowrate;
>>   z = lossFactor;
>>   v = q / A;
>>   Re = v * d / ( m / r);
>>   dp = z * r/2 * v^2;//genericPressureLoss(z, v, r);
>>   inPort.pressure = outPort.pressure + dp;
>> end Conduit;
>>
>> model Nozzle         "also usable for broken (deburred) inlet
>> opening"   extends Conduit;
>>   parameter Real inDiameter = 1e6; // "approximation of a broken (deburred) 
>> inlet from ambience";
>> protected
>>   final parameter Real dI = inDiameter;
>>   final parameter Real dO = referenceDiameter;
>> //algorithm
>> equation
>> //  assert( dI < dO, "Inlet smaller than outlet!  Use a diffuser instead");
>>   lossFactor = 1.04 - (dO/dI)^4; // loss factor includes the acceleration 
>> work r/2 v^2
>>                               // 0.04 is from VDI Wärematlas 7th issue
>>                               // 0.05 from Dubbel 16th issue
>> //  annotation (Documentation (info= "The nozzle is also a good
>> //  approximation for deburred intakes z = 0.05, rounded intake: z = 0.005
>> //  to 0.05, very sharp edged intakes: up to z = 0.5 (taken from VDI
>> //  Wärmeatlas 7th issue)")); end Nozzle;
>>
>> model Ambience
>>   Port port;
>> equation
>>   port.pressure = ambientPressure;
>> end Ambience;
>>
>> model PressureBoundary
>>   parameter Real p = 3e5;
>>   Port port;
>> equation
>>   port.pressure = p + ambientPressure;
>> end PressureBoundary;
>>
>> model PumpStage
>>   // TODO: leakage! TwoPorts is tight!
>>   extends TwoPorts;
>>   parameter Real V = 0.8054e-6       "0.8054e-6 VDO, 2.05e-6: GKN";
>>   parameter Real s = 0.03e-3 "tooth gap";
>>   parameter Real b = 6e-3    "Stage breadth";
>>   parameter Real l = 0.4e-3  "effective tooth gap length";
>>   parameter Real e0 = 0.975  "volumetric efficiency at '0 bar'";
>> //protected
>>   Real qt; // tooth leakage
>>   Real n                     "revs";
>>   Real m, dp, q, qq;
>> equation
>>   m = fluid.viscosity;
>>   n = time;
>>   dp = outPort.pressure - inPort.pressure;
>>   qt = b*s *  dp*s^2 / ( 12*m*l);
>>   q = e0*V*n;
>>   qq = q - qt;
>>   inPort.flowrate = if q < qt then 0 else qq;
>> end PumpStage;
>>
>> model Test
>>   inner Fluid fluid(viscosity = 3.3e-3, density = 850);
>>   Nozzle nozzle;
>>   Ambience ambience;
>>   PressureBoundary pressure;
>>   PumpStage pump;
>> equation
>>   connect( ambience.port, nozzle.inPort);
>>   connect( nozzle.outPort, pump.inPort);
>> //  connect(ambience.port, pump.inPort);
>> //  connect( ambience.port, pump.inPort);
>>   connect( pump.outPort, pressure.port);
>> end Test;
>> end Idiot;

Reply via email to