jass.generators
Class OpenWebsterTube

java.lang.Object
  extended by jass.engine.Out
      extended by jass.engine.InOut
          extended by jass.generators.OpenWebsterTube
All Implemented Interfaces:
Sink, Source

public class OpenWebsterTube
extends InOut

Author:
Kees van den Doel (kvdoel@cs.ubc.ca) Implement Webster equation with open ends (pressure=0) and external fluid force applied on left end. u,f on o grid, S (area) on both p on x grid, p=0 on boundaries O x o x o x o x O N grid points, N is odd. Let i= 0,...,N-1 S[i] p[i=0,2...,N-1], u[i=1,3,..,N-2], same for f[] Physical parameters: - pressure deviation PP = rho * p (rho = dmass dens. air) - velocity UU = u/c - force on fluid FF = (rho/c)*f CFL conditions give delta_x = h > c/2*srate.

Field Summary
protected  double c
           
protected  double[] d_pu
           
protected  double h
           
protected  double len
           
protected  double minLen
           
protected  int N
           
protected  double[] outBuf
           
protected  int overSamplingFactor
           
protected  double[] pu
           
protected  double[] S
           
protected  double[] Sold
           
protected  float srate
          Sampling rate in Hertz.
 
Fields inherited from class jass.engine.InOut
sourceContainer, sourcePassivity, srcBuffers
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
OpenWebsterTube(float srate, int bufferSize, TubeModel tm)
          Create and initialize.
 
Method Summary
 void changeTubeModel()
           
protected  void computeBuffer()
          Compute the next buffer and store in member float[] buf.
 void reset()
           
 void setAllAreas(double[] a)
          Set all areas
 void setArea(int k, double a)
          Set an individual segment area
 
Methods inherited from class jass.engine.InOut
addSource, addSource, getBuffer, getSources, removeSource, resetTime
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBufferSize, getTime, peekAtBuffer, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

srate

protected float srate
Sampling rate in Hertz.


minLen

protected double minLen

c

protected double c

len

protected double len

h

protected double h

overSamplingFactor

protected int overSamplingFactor

N

protected int N

S

protected double[] S

Sold

protected double[] Sold

pu

protected double[] pu

d_pu

protected double[] d_pu

outBuf

protected double[] outBuf
Constructor Detail

OpenWebsterTube

public OpenWebsterTube(float srate,
                       int bufferSize,
                       TubeModel tm)
Create and initialize.

Parameters:
srate - sampling rate in Hertz.
nTubeSection - maximum number of sections (must be even)
Method Detail

changeTubeModel

public void changeTubeModel()

reset

public void reset()

setArea

public void setArea(int k,
                    double a)
Set an individual segment area

Parameters:
k - index of segment (0,....N-1)
a - area to set

setAllAreas

public void setAllAreas(double[] a)
Set all areas

Parameters:
array - of r areas

computeBuffer

protected void computeBuffer()
Compute the next buffer and store in member float[] buf.

Specified by:
computeBuffer in class Out