jass.generators
Class OpenWebsterTube
java.lang.Object
jass.engine.Out
jass.engine.InOut
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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)
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