Home

The draft users manual (pdf

image

Contents

1. Figure 4 16 The distribution after 10 days compared to the steady state distribution from sstate 3 2mm and standard deviation 0 2 mmis used below For the neutral salinity of the egg a normal distribution with mean 34 5 psu and standard deviation 0 2 psu is used For simplicity it is assumed here that egg diameter and egg salinity are independent CHAPTER 4 EXAMPLES 44 Final distribution for each group 0 T T T T T Grp 1 Grp 2 Grp 3 Grp 4 100 apj 200 f 4 z 300 F 4 o a 400 f 4 500 f 4 600 1 L 1 L L 1 L 0 0 5 1 1 5 2 25 3 3 5 4 Egg concentration eggs m Figure 4 17 Final distribution of the 5 egg groups Mean depth of egg group T T T 100 200 300 Depth m 400 500 600 L 1 L L L L L L 1 Time days Figure 4 18 Time evolution of mean depth In the script runex7 a total of Nprof egg diameters and corresponding egg salinities are drawn randomly from the distributions above Thereafter eggvelst is used to compute the velocity profiles and sstate computes the vertical distribution The variable Anorm CHAPTER 4 EXAMPLES 45 contains the average of the distributions so far normalised so that the vertical integral equal M eggs m The script plotex7 is used to plot the results With Nprof 1000 the averaged vertical profile is given in figure 4 19 Nearly all th
2. Thereafter the root mean square error and the errors in mean depth and standard deviation is computed by R ve_rmsd X B Emean ve_mean X Bmean Estd ve_std X Bstd For plotting purposes the errors in the methods are given as the columns in Y Y X B ones 1 4 The results are summarized in a table made by the fprintf command A better formatted version of this table for a standard run is given in table 4 1 While performing such sensitivity tests under MATLAB the diary function can be useful It saves the commands and responces in the text window to a file for later use The tests presented here belong to two groups The first has K 0 01 m s and W 0 001 ms the same values as used in previous examples The exact stationary solution with dz 1 is given as fig 4 1 CHAPTER 4 EXAMPLES 31 Computational stationary solution 0 T T T T T ftes Iwendrof 10 upstream H minlim Depth m 1 1 1 ji EE a 300 200 100 0 100 200 300 400 500 600 700 Egg concentration eggs m Figure 4 4 The numerical stationary solutions with parameters K 0 01m s w 0 001 ms dz 2m dt 120s The reference run is done by with a space step of 2 mand atime step of two minutes The resulting solutions are given in fig 4 4 All methods except the upstream scheme produced solutions that can not be distinguished from each other and the exact solution in the figure The ups
3. the stationary problem with constant values of eddy diffusivity and egg velocity In addition more visualisation techniques including animation is demonstrated The online scripts for CHAPTER 4 EXAMPLES 26 Stationary solution with source term 40 Depth m amp A o dh O oO Oo oO o fo o fo L 7 5 8 8 5 9 9 5 10 10 5 11 11 5 Concentration eggs m x10 Figure 4 2 Steady state solution with constant coeffients including spawning and mortality this example is runftcs runus runlw runfl plotex2 and animex2 Of these one of the run scripts must be run first to produce the data for the visualization scripts The model is set up by giving values to the defining parameters H 100 dzO 2 vA dt 120 outstep 1 simtime 96 KO 0 01 WO 0 001 MO 1000 h Depth m Grid size m Time step s Time between saving of model results hours Total simulation time hours Eddy diffusivity m 2 s Egg velocity m s Vertical integral of concentration eggs m 2 The space variables is used to initialize the grid for VertEgg ve_init ve_grid H dz0 Further time variables are needed nstep outstep 3600 dt Number of steps between outputs nout simtime outstep Number of output steps CHAPTER 4 EXAMPLES 27 To make a start distribution concentrated at 50 m use the spawn function AO spawn MO 50 alternatively a random initial condit
4. 3 2 W eggvelst S T eggdiam 1000 0 eggsal M 100 ASS sstate M K W CHAPTER 4 EXAMPLES 41 Egg velocity mm s Steady state solution T T T T T T 100 4 100 200 F 200 f E 300 f J 300 H o a 400 F J 400 F 500 J 500 F 600 600 2 1 0 2 0 1 2 3 4 Eggs m Figure 4 13 Egg velocity and stationary ditribution The profiles are plotted in figure 4 13 The vertical dotted line in the left indicate zero velocity The neutral salinity 34 5 occur at approximately 125m depth in the pycnocline layer where the vertikal mixing coefficient is very low The stationary solution is therefore a very narrow peak at this depth level Before running the transient simulation it is useful to look at the numerical character istics of the problem With Az 5m and At 600s the profiles are plotted in figure 4 14 All the three linear methods are stable However the methods are not suitable because the high Peclet numbers give high numerical diffusion in the upstream method and pro duce negative values with FTCS and Lax Wendroff Therefore the more time consuming method posmet is used for the transient simulations The model script start by reading the setup file Thereafter the vertical physical profiles are read in and interpolated as above Similarly the inital egg distribution is read from file halibut dat and interpolated to the egg points Initially the eggs are di
5. Ci Si bi 5ci l x Ci Si From Appendix B 2 2 the conditions for positivity are lal lt 2s e 1 2 N 1 1 8 Sit lt 1 3 ci C41 zle Cia i 2 N 1 The first condition can be restated as peel lt 2 ede e With constant coefficients the positivity conditions reduce to lel Se 28 lt 1 which is stronger than the stability condition e 2s lt 1 16 2 23 2 24 2 25 2 26 2 27 2 28 There is no second order numerical diffusion in the transient solution Wiggles will not occur if the positivity condition 2 26 is fulfilled This method is implemented in the toolbox as the function lwendrof The Upstream Scheme A non centred alternative is the upstream method This is the method used by Westgard 1989 The upstream scheme is studied in all books on the subject The same diffusive flux 2 11 is used but the convective flux is estimated on the inflow side conv F Wj Pi W Pi 1 where 1 x ifr gt 0 xt z z nn zl 2 0 ifr lt 0 and x7 x xt In the notation of equation 2 8 the method is given by K K we e es Qi w a Az pi Wi Az and non dimensionalised by ai cf Si bi Si 2 29 2 30 2 31 2 32 CHAPTER 2 NUMERICAL METHODS 17 From Appendix B 2 2 the positivity condition is simply cf c Si Sipi lt 1 2 33 With constant coefficients this reduces to le 2s lt 1 2
6. Linear central finite difference methods In Numerical Methods for Advection Diffusion Problems Vreugdenhil and Koren 1993 65 BIBLIOGRAPHY 66 C B Vreugdenhil and B Koren Numerical Methods for Advection Diffusion Problems Vieweg Braunschweig 1993 T Westgard Two models of the vertical distribution of pelagic fish eggs in the turbulent upper layer of the ocean Rapp P v R un Cons int Explor Mer 191 195 200 1989 C S Yih Fluid Mechanics West River Press Ann Arbor 1977
7. kgm s 1 47 This reproduces table 1 1 with an absolute error less than 2 x 1075 kgm7 s and a relative error of 1 7 This is good enough to compute egg velocities where the uncertainty in the other variables are larger This formula is implemented by the function molvisc in the toolbox Riley and Skirrow 1975 give a more precise formula which requires more computational effort Chapter 2 Numerical Methods The numerical solutions are computed on a fixed equidistant grid The number of grid cells is denoted N and the cell height is Az The grid is staggered as shown in fig 2 1 The z axis points upwards The cell interfaces the flux points are zi 1 i Az for i 1 N 1 2 1 The cell centers the concentration points or the egg points are i t I z ZTH 5 i Az tor t Slaa Ne 2 2 Fun Pi Fi Pia Fia x x gt Zi 1 i Zi Bj i 1 Figure 2 1 Horizontal view of the vertical grid The variables are discretized in the following ways The egg concentration y represents the mean concentration in cell 7 that is pide f elz dz i 1 N 2 3 Zi 1 The y values may be considered living on the egg points Z as in fig 2 1 As the flux values are computed from the vertical velocity and the eddy diffusivity F w and K are taken as point values on the flux points z for i 1 N 1 The source terms P and a are cell averages and live on the egg points 12 CHAPTER 2 NUMERICAL METH
8. 1 3mm and neutral salinity 36 psu The tool eggvelst is used to compute the velocity profiles di 0 0015 Sel 33 W1 eggvelst S T d1 Sel d2 0 0013 Se2 36 W2 eggvelst S T d2 Se2 The number of eggs are 55 in each group and the initial distribution is the same step function in each group The arrays A1 and A2 are used for the concentrations within the groups I10 ones 10 1 A1 1 10 O 110 A1 11 20 0 75 110 A1 21 30 1 25 110 A1 31 40 0 75 110 A1 41 50 0 I10 Use the same initital distribution for group 2 A2 Al Save the intial distributions for later use A10 A1 A20 42 AO A10 A20 The model is here run by the Lax Wendroff scheme with a time step of 120s and saving the result every 2nd hour The total simulation time is 96 hours CHAPTER 4 EXAMPLES 38 Initial distribution Distribution after 12 hours Depth m S T 100 1 L 1 i J 0 0 5 1 1 5 2 2 5 Concentration eggs m gt Figure 4 10 Figure 1 from Westgard 1989 for t i nout A1 lwendrof A1 K W1 nstep dt X1 t A1 A2 lwendrof A2 K W2 nstep dt X2 t AQ end Finally the results from the two groups are added X X1 X2 Visualising the results with plotex5 the first task is to reproduce figure 1 from Westgard 1989 t12 12 outstep hold on plot a0 ZE y 3 The start distribution plot X t12 ZE g After 12 hours Thi
9. 34 which is also the stability condition The numerical diffusion in the upstream scheme may be quite large 1 Krii m zwAz 1 cl 2 35 This is negligible if Knum lt K or equivalently pee lt aa 2 36 The upstream scheme is implemented in the toolbox as the function upstream 2 1 2 Nonlinear methods The Lax Wendroff scheme is second order in space but may develop wiggles and negative concentration values The upstream method is positive but may be too diffusive These are fundamental problems with linear schemes Several nonlinear schemes has been developed to overcome these problems A general idea is to combine the Lax Wendroff and upstream methods to produce positive schemes with low numerical diffusion Overviews of such methods are given by LeVeque 1992 and in the collection Vreugdenhil and Koren 1993 Egg distribution problems are somewhat non symmetrical It is important to have high accuracy near maxima where most of the eggs are found Local minima are less interesting and they occur more seldom in the interior of the water column For instance with the steady state solution 1 20 without source terms a local minimum in the interior can occur only in static instable situations when the egg is lighter than the water above and heavier saline than the water below The methods below are not total variation diminishing TVD as some of the more advanced non linear methods Instead of a finely tuned linear combi
10. Wide Web 64 Bibliography J W Eaton Octave 1 1 edition 1995 User manual available by anonymous ftp from bevo che wisc edu in directory pub octave C A J Fletcher Computational Techniques for Fluid Dynamics volume I Springer Verlag 2 edition 1991 T Haug E Kj rsvik and P Solemdal Vertical distribution of Atlantic halibut eggs Can J Fish Aquat Sci 41 798 804 1984 R J LeVeque Numerical Methods for Conservation Laws Birkhauser Verlag Basel 2 edition 1992 P P Morgan SEAWATER A library of MATLAB Computational Routines for the Prop erties of Sea Water CSIRO Marine Laboratories 1994 Report 222 J P Riley and G Skirrow Chemical Oceanography volume 2 Academic Press 2 edition 1975 P J Roache Computational Fluid Dynamics Hermosa Publishers Albuquerque 1972 K Sigmon MATLAB Primer CRC Press 4 edition 1994 G G Stokes On the effect of the internal friction on the motion of pendulums Cambridge Trans 9 1851 S Sundby A one dimensional model for the vertical distribution of pelagic fish eggs in the mixed layer Deep Sea Research 30 645 661 1983 S Sundby Factors affecting the vertical distribution of eggs ICES mar Sct Symp 192 33 38 1991 H U Sverdrup M W Johnson and R H Fleming The Oceans Prentice Hall 1952 UNESCO Tenth rep of the joint panel on oceanographic tables and standards UNESCO Tech Pap in Marine Science No 36 1981 C B Vreugdenhil
11. condition lt 1 for all values of then becomes a b lt a b lt 1 B 33 In this case the positivity conditions eqs B 27 B 31 are reduced to a gt 0 b6 lt 0 a b lt 1 B 34 which is is stronger than the stability condition B 2 3 Positivity with loss term Egg production works to enhance the positivity of the solution while loss of eggs may ruin an otherwise positive solution For the analysis of this situation we use equation 2 7 with F given by the nondimensional form 2 9 and the source term Q given by eq 2 40 Substitutitint the F and Q terms in 2 7 gives the following genrealisation of eq B 25 pt ea bipi 0 a bii Pi GY 7 2 N 1 B 35 If this should be positive regardless of P the conditions B 29 B 31 must be strengthened b lt est B 36 ai bipi lt TY i 2 N B 37 ay ee B 38 Appendix C Future work Hopefully as the toolbox is put to use it will develop to better suit the need of scientists in the field Below is an unsorted list of things that may be included Better numerical schemes for the convection diffusion equation Implementation of Lagrangian particle tracking approach Implement analytical transient solution of convection diffusion equation with con stant coefficients More functions for analysis of observed egg distributions Non uniform vertical grid Ekman solver Turbulence model s Homepage for VertEgg on World
12. function eggvel in the VertEgg toolbox The buoyancy of a fish egg is often given as the salinity Se where the egg is neutrally buoyant The function eggvelst computes the terminal velocity in this case CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS 11 To compute the egg velocity the density p of water is needed In the toolbox only density at surface pressure is presently available This is computed by the function denso by the UNESCO formula UNESCO 1981 The function sw_dens in the SEAWATER toolbox Morgan 1994 has implemented the full UNESCO equation of state The dynamic molecular viscosity u of sea water is tabulated in table 1 1 taken from Sverdrup et al 1952 The values decrease with temperature and increase slowly with salinity The dependence on pressure is insignificant and is neglected here Salinity Temperature C psu 0 5 10 15 20 25 30 0 1 79 1 52 1 31 1 14 1 01 0 89 0 80 10 1 82 1 55 1 34 1 17 1 03 0 91 0 82 20 1 85 1 58 1 36 1 19 1 05 0 93 0 84 30 1 88 1 60 1 38 1 21 1 07 0 95 0 86 35 1 89 1 61 1 39 1 22 1 09 0 96 0 87 Table 1 1 Dynamic molecular viscosity of sea water with unit 10 kem s Using linear least squares regression the table is approximated by the following function where T is the temperature in C and S is the salinity in psu u 107 1 7915 0 0538 T 0 007 T 0 0023 S
13. returns array of pointwise values If Z is not present returns exact cell averages eggvel Terminal egg velocity Usage W Re eggvel drho d mu CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 50 Input drho Buoyancy of egg kgm d Diameter of egg m mu opt Dynamic molecular viscosity kem7 s 1 drho d and mu can be matrices of the same shape mu can be also be a scalar or omitted The sign of drho is positive if the egg is ascending drho Density of water density of egg With only two arguments a default value 0 0016 is used for mu Output W Terminal velocity ms Re opt Reynolds number Description Computes the terminal velocity of a small sphere in sea water by the formulas in Stokes or Dallavalles formula eggvelst Egg velocity from salinity and temperature Usage W Re eggvelst S T d Se Input S Salinity of the environment psu T Temperature C d Egg diameter m Se Egg salinity psu All arguments can be arrays of the same shape Alternatively d and or Se may be scalars Output W Terminal velocity ms 1 Re opt Reynolds number Description Computes the terminal egg velocity given the hydrography of the environment and the salinity Se where the egg is neutral buoyant fluxlim Numerical integration of transport equation Usage A fluxlim AO K W nstep dt P alpha Input AO Start concentration eggs m K Eddy diffus
14. to equation 1 34 and boundary conditions 1 10 then y H z is a solution the same equation and boundary conditions with the opposite sign on w In other words p w 2 Yu H 2 1 41 1 3 The Terminal Egg Velocity An egg in sea water will reach its terminal velocity w where the buoyant forcing balances the frictional drag This velocity is a function of the difference Ap p pe between the density of the water and the egg the egg diameter d the acceleration g due to gravity and the molecular viscosity Here the dynamic molecular viscosity u is used The situation is characterised by the non dimensional Reynolds number pene 1 42 u For low values Re lt 0 5 the terminal velocity is given by Stokes formula 1 gd A para 1 43 18 u This formula was obtained by Stokes 1851 The derivation of the formula is given in almost any textbook on fluid dynamics for instance Yih 1977 Combining these equations one obtains an expression for D the maximum diameter for which Stokes velocity applies 2 p 1 44 pgAp In the intermediate region 0 5 lt Re lt 5 Dallavalle 1948 gave an empirical formula w K d CD Aput 1 45 where 0 4 for a sphere The coefficient A is determined by the requirement that both formulas should give the same answer for Re 0 5 or equivalently d D This gives K o1 3g 3 p13 0 0875kg7 1 3 m 3s 4 3 1 46 The formulas above are implemented as the
15. 1991 Here both flux components are centred around z 2 Few y EY 2 10 Fett Ke 2 11 In the notation of equation 2 8 the method is given by Sige yn K MT aah a a a 2 12 CHAPTER 2 NUMERICAL METHODS 15 and non dimensionalised by 1 1 ay 9 Si bi 9 y 2 13 The following positivity condition for the FTCS scheme follows from the general con dition in Appendix B 2 2 loi lt 2s i 2 N 2 14 1 sg lt 1 9 2 15 1 S Sigi lt 1 56 cit t 2 N 1 2 16 1 sn lt 1 gon 2 17 The first condition can be restated as P lt 2 With constant coefficients the positivity conditions reduce to lel Sees 2 18 which is stronger than the stability condition eae 2 19 The numerical diffusion is negative 1 Ka zv At 2 20 which is negligible if c lt 2s This method is implemented in the toolbox as the function ftcs The Lax Wendroff Scheme An alternative is the Lax Wendroff scheme as analysed for instance in Vreugdenhil 1993 The scheme compensates for the negative numerical diffusion in FTCS The diffusive flux is still given by equation 2 11 but the convective flux is modified Feces wee 1 p 2 5 a zri Az P yi 2 21 In the notation of equation 2 8 the Lax Wendroff method is given by 1 At K 1 At K Ry Ax Bi zvil i Ap 2 22 CHAPTER 2 NUMERICAL METHODS and non dimensionalised by 1 1 Qi zel
16. 4 Diffusive parameter Si Ka 2 5 Cell Peclet number pos mils sl 2 6 If the coefficients w and K are constant the subscripts are simply dropped For fish eggs the terminal velocity is in the order of a couple of millimetres per second The velocity can be positive pelagic eggs negative benthic or change sign some place in the water column mesopelagic The vertical eddy diffusion show a very large range of variation from more than 107 m s in the upper mixing layer to 10 m s in the pycnocline layer With a grid size of the order of one meter the Cell Peclet number Pee take values from 107 to 10 This means that the process may be dominated by diffusion in the upper layer and convection below The numerical methods considered here are finite difference or really finite volume schemes given in conservation form or flux formulation These methods are conceptu ally natural working directly with the integral form of the conservation law 1 2 More precisely the equation 1 2 is approximated by ptt o Az FR FM At QPAzAt i 2 N 2 7 where the superscripts indicate the time step The boundary conditions 1 10 simply become F Fy 0 The various methods differ in their estimation of the total flux CHAPTER 2 NUMERICAL METHODS 14 function F Fee Ff and the source term Q One advantage of this flux formulation is that mass conservation is automatically fulfilled as the fluxes cancel out d
17. L 0 100 200 300 400 500 600 700 800 900 1000 Number of samples Figure 4 20 Development of the root mean square increment 46 Chapter 5 Reference Manual VertEgg Version 0 9 5 1 Overview of the Toolbox The VertEgg toolbox presently contain the following tools grouped here according to functionality e Initialise VertEgg ve_init ve_grid Hcol dz e Make initial egg distribution spawn M Z ve_rand M e Compute the stationary solution eggsact M K W Z srcsact K W P alpha sstate M K W e Solve the transient problem numerically fluxlim AO K W nstep dt P alpha ftcs AO K W nstep dt P alpha lwendrof A0 K W nstep dt P alpha upstream A0 K W nstep dt P alpha 47 CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 e Compute terminal egg velocity dens0O S T eggvel drho d mu eggvelst S T d Se molvisc S T e Analyse distributions eggmom A p ve_drint A z1 z2 ve int A ve mean A ve_std A ve_rmsd A B 5 2 Description of the Tools dens0O Sigma T of sea water at zero pressure Usage sigma dens0 S T Input S Salinity psu T Temperature C S and T may be arrays of the same shape Output sigma Sigma T value kgm sigma is an array of the same shape as S and T Description 48 densO computes the a value density 1000 of sea water at zero press
18. ODS 13 2 1 The Transient Problem The numerical solution of the convection diffusion equation 1 4 are covered by several authors A classic source is Roache 1972 A newer source is chapter 9 in the book by Fletcher 1991 Recently a whole book edited by Vreugdenhil and Koren 1993 has been devoted to this equation For conservative methods as will be used here the book by LeVeque 1992 is also recommended For our problem convection and diffusion of concentration of fish eggs some properties of the numerical method is important Fish eggs are usually found in a subrange of the water column with values close to zero outside this range And of course a real concentra tion do not have negative values The method must therefore be positive that is it must not create any negative values In the absence of source and sink terms eggs are not created or destroyed The vertical integrated concentration is therefore constant in time as shown in section 1 2 1 The numerical method should have the same property it should be mass conserving Of course the numerical solution should be as close as possible to the real solution That is the accuracy of the method should be good This concept includes low artificial diffusion and no or very limited wiggles development A convection diffusion problem is characterised by the following non dimensional numbers all defined at the interior flux points z for i 2 N Courant number Ci w 2
19. VertEge A toolbox for simulation of vertical distributions of fish eggs Version 1 0 Bjorn Adlandsvik Institute of Marine Research P O Box 1870 Nordnes N 5024 Bergen Norway E mail bjorn imr no January 26 2000 Contents Introduction 1 Theory of Vertical Egg Distributions 1i The Equations ecer e tn ee dled he ee he els he Bet oe Wet oe a 1 2 Solutions of the equations 4626 eg ee eee Oe ee ee ee a 1 2 1 122 Vertical integrated equation ooa ooa a Stationary Solution o an 2 aea a a oA oe E a we eae Se eS Constant coefficients o oo o a a a Piecewise constant coefficients 2 ooo e a e Linear coefficients ooa a a a Stationary solution with source terms o o 1 3 The Terminal Egg Velocity aoaaa eo eee Numerical Methods 2 1 The Transient Problem ooa a 2 1 1 Linear conservative schemes 0 The FTCS scheme o oaoa aa a The Lax Wendroff Scheme The Upstream Scheme oaa ee eer aes 2 1 2 Nonlinear methods aoaaa aa a The positive method 4 wep we ine aide ine ef end The minimum limiting method 2 1 3 The Source Term 00 0 2 2 The Stationary Problem 2 0 G2 3 0 koe ge Bad eS Working in the MATLAB Octave Environment 3 1 Implementation of the VertEgg Toolbox Examples 4 1 Example 1 The stationary solution with constant coefficients 4 2 Example 2 Transient solution with constant coeffi
20. With MN 35 5 x 7 the normal matrix is simply A ones MN TI TI 2 SI In MATLAB the vector X of coefficients is found by V X eye MN Covariance matrix identity lscov A B V in Octave the same task is done by X ols B A 4 5 Example 5 Non constant coefficients This example illustrates how to use several egg groups on a transient problem with non constant coefficients It also provides a verification of parts of the toolbox by reproducing results by Westgard 1989 The model is contained in the script runex5 The results are visualized by the scripts plotex5 and by animation in animex5 The problem is the first example from Westgard 1989 The bottom depth is 100m and a grid size of 2m is used CHAPTER 4 EXAMPLES 37 ve_init ve_grid 100 2 There is a pycnocline at 50m with temperature 7 C and salinity 34 above and temperature 5 C and salinity 35 below I25 ones 25 1 S 1 25 34 125 S 26 T 1 25 7 I25 T 26 34 5 27 51 35 125 6 T 27 51 5 I25 The wind speed is 5ms The turbulent eddy viscosity in the upper layer is computed by a formula form Sundby 1983 The turbulence in the lower layer is 1 10 of the value in the upper layer Wind 5 KO 76 1 2 26 Wind 2 1e 4 K 1 25 KO I25 K 26 0 55 KO K 27 51 0 1 KO 1I25 There are two groups of eggs one with a diameter of 1 5mm and neutral buoyancy corre sponding to 33 psu and the other with a diameter of
21. ad from files The model script is meant to be a prototype simulation model It should be easy to modify for similar simulations The script plotini is used to plot the physical and numerical situation before the simulation while plotgrp3 and plotres are used for postprocessing of the model results First the physical profiles will be plotted The profiles are read from file and thereafter interpolated to the flux points The variable names are S for salinty T for temperature CHAPTER 4 EXAMPLES 40 and K for vertical mixing coefficient Several profiles are combined into one figure by the Matlab command subplot subplot 1 3 1 plot S ZF title Salinity subplot 1 3 2 plot T ZF title Temperature subplot 1 3 3 semilogx K ZF Logarithmic X axis title Vertical mixing The result is shown in fig 4 12 Salinity Temperature Vertical mixing 0 T T 0 T T 0 100 4 1007 4 1007 200 4 2007 4 200 E 300 q 300f J 300 D a 400 4 4007 4 4007 500 q 500f q 500F 600 600 600 33 34 35 36 2 4 6 10 10 psu deg C m s Figure 4 12 Vertical profiles of salinty temperature and vertical eddy viscosity With the values 34 5 psu for egg salinity and egg diameter 3 2mm eggvelst can be used to compute the egg velocity Thereafter the stationary solution with integrated density 100 eggs m can be computed by sstate eggsal 34 5 eggdiam
22. al space FTCS method Starting with the concentration in AO nstep integration steps are performed The result is saved in A lwendrof Numerical integration of transport equation Usage A lwendrof A0 K W nstep dt P alpha Input AO Start concentration eges m K Eddy diffusivity m s W Terminal velocity ms 1 nstep Number of integration steps CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 52 dt Time step s P opt Spawning term eges m s alpha opt Loss coefficient 1 s AO lives at the egg points size AO Ncell x 1 K and W live at the flux points size Ncell 1 x1 If P and alpha are present they also live at the egg points If P and alpha are missing the source term is ignored Output A Result concentration eggs m A lives at egg points in the same way as AO Description Integrates the convection diffusion equation by the Lax Wendroff method Start ing with the concentration in AO nstep integration steps are performed The result is saved in A molvisc Dynamical molecular viscosity of sea water Usage mu molvisc S T Input S Salinity psu T Temperature C S and T may be arrays of the same shape Output mu Dynamic molecular viscosity kem s mu is an array of the same shape as S and T Description Computes the dynamic molecular viscosity by formula 1 47 spawn Make concentrated egg distribution Usage A s
23. ative values if the upstream scheme is stable Steps 1 and 2 in the algorithm are identical to the positive scheme The third step is modified to 3 Where gf lt min y pts recompute F and F by the upstream formulation 2 29 and diffusion 2 11 This scheme is implemented in the toolbox as the function minlim 2 1 3 The Source Term Neglecting the fluxes for the moment the transport equation 1 9 reduces to an ordinary differential equation dp P ag 2 37 A ay 2 37 The numerical scheme 2 7 reduces to git gf Qt 2 38 The exact solution of 2 37 with constant coefficients is P yt oe Gog 1 _ ERI 2 39 CHAPTER 2 NUMERICAL METHODS 19 This is in the form 2 38 with a At l1 e Qi P aigi 2 4 This scheme will never produce negative concentration values Combining this with the convection diffusion solvers above is straightforward The combined positivity condition becomes more restrictive as discussed in Appendix B 2 3 In general the number 1 appearing as upper limit must be replaced by exp aAt For instance with constant coefficients the positivity conditions for the familiar linear schemes become FTCS le lt 2s ee 2 41 Lax Wendroft eo hse 2 42 Upstream lel 2s eet 2 43 2 2 The Stationary Problem In many problems only the steady state solution is needed Also for transient problems a fast and accurate way of reaching the stationary
24. by integrating 1 15 Fe f aejds f Qas 1 17 Without source term the expression above reduces to F 0 i e the net flux is zero everywhere This simply says that in a steady state convection is balanced by diffusion we Ka 0 1 18 CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS T This is an ordinary differential equation for y z The boundary conditions 1 10 does not contain more information A unique solution can nevertheless be singled out by the integral condition J p z dz 1 19 H In other words among all the solutions of 1 18 choose the one with correct vertically integrated concentration To simplify the notation put m w K and let M z f m s ds Then the stationary solution is ylz 0 1 20 Constant coefficients The case with constant coefficients was studied by Sundby 1983 In this case M z mz and the solution is a truncated exponential distribution m mz In the toolbox this solution is computed by the function eggsact This solution has the following symmetry between ascending and descending velocity P m 2 Pm H 2 1 22 With large depth and or high ascending velocity the effect of the bottom may be neglected In this case the distribution is well approximated by an exponential distribution with parameter 1 m that is Pilz x Pme for mH gt l 1 23 For positive values of m the following series development from Sundby 1983 is valid Pmlz Pm
25. c partial differential equations is called the convection diffusion or transport equation The boundary conditions are simply no flux across the surface and bottom F 0 t F H t 0 1 10 and the initial condition is given by y z 0 yolz H lt z lt 0 1 11 CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS 6 1 2 Solutions of the equations Under simplified circumstances the equations in section 1 1 can be solved analytically This section examines some of these solutions 1 2 1 Vertical integrated equation Let denote the total concentration jc pdz Take the vertical integral of equa tion 1 9 and use the boundary conditions 1 10 gives 0 a pe f ay dz 1 12 H where Pi re Pdz is the total spawning contribution Without any source terms the total concentration is constant To reach a steady state solution with spawning the loss term a must be nonzero If is a positive constant the solution to the equation above is Piet P t O 0 1 e 1 13 a with steady state solution P a If a 0 the solution is simply D t O 0 tP 1 14 1 2 2 Stationary solution A stationary solution solves the conservation law 1 4 without the time derivative dF a 1 1 i 1 15 with boundary conditions F 0 F H 0 given by 1 10 The condition for the existence of this solution is that the total source term vanishes Ot fo dz 0 1 16 the flux function is then given
26. cients 4 3 Example 3 Sensitivity studies 2 00 4 4 Example 4 Terminal egg velocity DOD ANDADAA KR ie _ 13 14 14 15 16 17 17 18 18 19 21 21 CONTENTS 4 5 Example 5 Non constant coefficients 0 0 00004 ee 4 6 Example 6 Halibut eggs the transient problem 4 7 Example 7 Halibut eggs Monte Carlo simulation 4 8 Example 8 Halibut eggs with spawning and hatching terms Reference Manual VertEgg Version 0 9 5 1 Overview of the Toolbox age bee a ee Sake Pek a Se a 5 2 Des ription ok the Toolsi sizo pre aaan ek Be Sr Re Bre ea EGE Sok Installation A 1 Availability of the software ooa aa a ee ee A 2 Matlab under Microsoft Windows 0000084 A 3 Octave under WNIM s 4 eos cas wok a ee ee ee ee ee ah Mathematical digressions B 1 Exact solution of transient problem with constant coefficients B 2 Linear conservative schemes 000 002 eee eee B 2 1 Conditions for consistence da ee ae wee B 2 2 Conditions for positivity and stability 0 B 2 3 Positivity with loss term se Sas Se oe 8 oh Se a at et whe lh C Future work Bibliography 47 47 48 58 58 58 59 60 60 61 62 62 63 64 65 Introduction The vertical distribution of fish eggs in a water column is determined by the buoyant forcing and turbulent mixing A model of the steady state dis
27. ct to the inner product are m mz Xo 0 Bo I emH B 9 and for n gt 1 2 2 i Nn T oO Be 2H Xn 202 2ay cos Q z msin anz B 10 For Ay 0 the time dependent part Ap is constant The time dependent part corre sponding to A with n gt 1 is Anes B 11 This gives the general format for the solution of equation B 1 Oat gt D ane t Bn 2 B 12 n 0 The coefficients a are determined from the initial values y z 0 f z by Geb A f z2 Bn z je dz B 13 B 2 Linear conservative schemes The linear finite difference schemes considered in section 2 1 1 are all in conservation form 2 7 ppt ph Az FR Fp At B 14 a where the flux function have the forms 2 8 2 9 A F api bipi 1 aiy bipi 1 B 15 z At where the coefficients are independent of the y s APPENDIX B MATHEMATICAL DIGRESSIONS 62 B 2 1 Conditions for consistence A numerical scheme for a partial differential equation must be consistent this means that the scheme converges to the equation as the time and space steps approach zero Here the first expression F a y p _1 is used The y s are defined as cell averages in equation 2 3 For continuous functions a z 3 z and y z F F z where 7 z zt Az Poaza ae fo oxo aoa B 16 The Taylor expansion of y around z is PO lz HANE 2 eN 2 te B 17 Using this F can be expanded as the series P a f
28. data analysis and visualisation They also provide high level programming languages These programmes called M files come in two flavours scripts which are sequences of commands executed in batch and functions which can take and return ar guments Functions can also have local variables M files may be viewed as extensions of the basic system A collection of M files for a specific area is called a toolbox For marine research for example there exists a free toolbox for analysis of physical oceanographic data named SEAWATER Morgan 1994 The basic environments and the programming languages are quite compatible They provide the same basic data structure arrays of dimension up to two scalars vectors matrices This makes it possible to write M files that work equally well for both systems The systems have simple but powerful systems for online help The main difference between the systems is the much stronger graphic capabilities of MATLAB Octave is documented in Eaton 1995 MATLAB is documented in user and reference manuals there is also a nice little primer Sigmon 1994 3 1 Implementation of the VertEgg Toolbox The geometric setup of the problem is basic for all other work This setup is therefore given by a set of global variables which can be accessed in the work space and by all functions in the toolbox They are declared by the script ve_ init which contain the following statements global Ncell Number of grid cells
29. duced oscillations and negative values The upstream solution is quite smeared out while the flux limited method seem to perform quite well The table for this run is tab 4 2 RMSE E mean E std CPU time ftes 42 549 0 537 0 640 8 6 lwendrof 35 038 0 477 0 640 8 5 upstream 16 466 0 463 0 618 8 6 fluxlim 0 718 0 014 0 022 32 8 Table 4 2 Results from standard sinking run CHAPTER 4 EXAMPLES 80 Eggsact solution for sinking eggs 86 f 88 90 f Depth m 92 96 98 j 100 I 1 0 50 100 f 150 200 250 300 Egg concentration eggs m L 350 400 450 500 33 Figure 4 6 The exact stationary solution withk 0 0005 m s7t w 0 001 ms dz 2m 80 Computational stationary solution 82 84 86 88 j 90 f Depth m 92 F 94 96f ee 98 gt T ftes Iwendrof upstream H minlim 100 300 200 100 Figure 4 7 The numerical stationary solutions with parameters K 0 0005 m s w 0 001 ms dz 2m dt 120s f 0 100 200 300 Egg concentration eggs m 400 L 500 1 600 700 CHAPTER 4 EXAMPLES 34 4 4 Example 4 Terminal egg velocity This example verifies and demonstrates the function eggvel for computing the terminal egg velocities The script is velex in the example directory Incluided in this example is also
30. e as m gt Q 1 24 j 0 The zero th term of this expansion is the exponential distribution above For negative values of m the symmetry relation 1 22 can be used Ym z Pme ye m lt 0 1 25 j l CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS 8 Figure 1 1 Mean depth u as a function of m To compute the mean and variance of the distribution the constant factor can be dropped The moment generating function is then 0 a m4 t H m m l e t m ttzdz i 1 26 yl Teme m t eo Differentiating gives the moments of the distribution The mean depth is given by 1 H Y 0 1 27 p 0 1 27 The function u u m with H 100m is plotted in figure 1 1 The variance is a mH 2772 H 2 w 0 2 Em o e 1 28 m 1 e Piecewise constant coefficients The solution 1 21 can easily be extended to a piecewise constant m Let 0 z9 gt gt Zm H be a partition of the water column with m z m on the interval I zi 2 1 Then the stationary solution restricted to the interval J is given as z Cre for zi lt 2 lt Zi 1 1 29 The C s are determined by continuity of the solution Cie Cie 1 Sees 1 1 30 CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS 9 and the integral condition 1 19 i 1 e i i Mizi ach edz patiant ee yes 1 31 i 1 i This method is used in the function sstate to approximate
31. e certain tricks that must be used to gain acceptable per formance The most important is to use vector constructs instead of loops For instance to compute the central diffusive flux approximation 2 11 in Fortran 77 requires the loop DO 11 I 2 NCELL FDIFF I K I ACI 1 A I 11 CONTINUE A similar loop is also possible in MATLAB Octave but much better performance is achieved by the vector subscript Fdiff 2 Ncell K 2 Ncell A 1 Ncell 1 A 2 Ncel1l Under Octave the variable do_fortran_indexing should be true This gives better com patibility with MATLAB for vector subscripts The restriction to 2D arrays is removed in MATLAB version 5 Chapter 4 Examples This chapter contains several examples of different complexity on the use of the VertEgg toolbox The examples are also available on line as demo scripts Playing along and modifying these scripts is a nice way to learn to use the toolbox The online scripts come in two versions one for MATLAB and one for Octave This is partly due to differences in the languages and partly to take advantage of the more advanced graphic possibilities in MATLAB The examples are organized in separate direc tories Issuing the command help contents in the right directory brings up an inventory of the scripts 4 1 Example 1 The stationary solution with constant coefficients This example demonstrates the use of eggsact and srcsact for computing the exact sta
32. e eggs are found between 50 and 300m depth with high concentrations between 100 and 200m Also note the few heavy eggs are near bottom Stationary solution 0 T T T T P 100 200 F E 300 j E Depth m 400 4 500 J 600 L i i L 1 1 L 0 L L L 0 2 0 4 0 6 0 8 1 12 1 4 1 6 1 8 2 Concentration eggs m Figure 4 19 Vertical distribution of eggs from Monte Carlo run Thereafter some statistics of this solution is computed Because of the randomness in the Monte Carlo process these numbers and the shape of fig 4 19 may vary from run to run In our case we obtain the following numbers The egg diameters vary from 2 57 to 3 85mm with mean 3 19mm and standard deviation 0 21mm The egg salinities vary from 33 87 to 35 22 with mean 34 50 and standard deviation 0 20 psu The mean depth of the distribution is 135 1 mand the standard deviation is 50 7 m To visualize the convergence of the Monte Carlo run the root mean square deviation of the normalised distribution after i 1 and 7 iterations are saved in the array R i Figure 4 20 show the evolution of R on a logarithmic scale The convergence is quite slow and 1000 samples may be too few This explains why the shape of the distribution may vary from run to run 4 8 Example 8 Halibut eggs with spawning and hatch ing terms Under construction CHAPTER 4 EXAMPLES Root mean square increment 10 T T T T T 1 0 1 L L L L L L 1
33. global dz Vertical step size m global Hcol Depth of water column m global ZE Ncell vector of egg point depths m global ZF Ncell i vector of flux point depths m 21 CHAPTER 3 WORKING IN THE MATLAB OCTAVE ENVIRONMENT 22 Given the depth Hcol H and the grid height dz Az the rest of the values can be calculated This is done by the function ve_grid Hcol dz The vector ZE i 2 and ZF i z as defined in chapter The commands ve_init and ve_grid can be reissued at any time The only limitation is that ve_init must be called once before ve_grid and nearly all other VertEgg statements Many but not all of the commands have names starting with ve_ to not be mixed up with commands in the basic systems or other toolboxes This may be done more consequently in future versions A discretized egg distribution is represented by a column vector of length Ncell The elements are cell averages A matrix of size Ncell x n can be viewed as a collection of n distributions The commands in VertEgg and most general MATLAB Octave commands work on distributions as a whole For example plotting the vertical profile is done by the command plot A ZE The vector languages give a nice environment for working on 1D problems such as ver tical distributions For larger problems in 2D or 3D the limitation to 2D array and the performance penalty of an interpreted language make MATLAB Octave less interesting Even for 1D problems there ar
34. he University of Wisconsin The official web page is http bevo che wisc edu octave html The program is available by anony mous ftp from the official site bevo che wisc edu in the directory pub octave Source code and binaries for many UNIX workstations are available The current version August 1995 is 1 1 1 Octave uses gnuplot as its graphic library The VertEgg toolbox will work without the graphics but most of the examples will not To do any serious work with Octave gnuplot must be installed before Octave Gnuplot is also a useful program by itself From the frequently asked questions FAQ about gnuplot Gnuplot is a command driven interactive function plotting program It can be used to plot functions and data points in both two and three dimensional plots in many different formats and will accommodate many of the needs of today s scientists for graphic data representation Gnuplot is copyrighted but freely distributable you don t have to pay for it Gnuplot has many authors and is available on all platforms The official www home page for gnuplot is http www cs dartmouth edu gnuplot_info html the program is available by anonymous ftp from ftp dartmouth edu in the directory pub gnuplot and many other cites The current version August 1995 is 3 5 but beta releases of version 3 6 are updated frequently The natural place for the VertEgg toolbox directory is usr local lib octave site m vertegg where it automaticall
35. ion can be given by AO ve_rand MO As the solvers need vectors as input KO and WO must be converted into constant column vectors K KOxones Ncell i 1 W WOxones Ncell i 1 We will use A for the calculations and X for saving the results A AO X Remove any old stuff in X The time integration loop can be written as for t i nout A lwendrof A K W nstep dt X t A end After computing the solution the results must be analysed and visualised The final result from runlw is stored in A The following code fragment plots the profile of A and the exact stationary solution B plot A ZE hold on Don t wipe out graphics before next plot B eggsact MO KO WO plot B ZE r7 hold off legend Numerical solution Exact solution For Octave remove the legend statement The convergence of the solution to a steady state can be studied by looking at the time development of the mean T 1 nout TL Txoutstep Time labels mu ve_mean X The means plot TL mu An alternative is to look at the root mean square deviation from the exact solution B Sjekk om her er noe semilog greier R ve_rmsd X B plot TL R CHAPTER 4 EXAMPLES 28 Root mean square deviation from exact solution eggs m 3 RMS deviation 2 10 oO 10 20 30 40 50 60 70 80 90 100 Time hours Figure 4 3 Convergence to steady state with Lax Wendroff method By removing the f
36. irst 24 hours the convergence is easier to see This result is depicted in figure 4 3 T2 24 nout TL2 T2 outstep plot TL2 R T2 The two next figures are MATLAB only Surface graphics in Octave gnuplot is to primitive yet The first is a isoplet diagram a contour plot of the solution in the time depth plane cl 10 10 110 Contour levels c contour TL ZE X cl clabel c A more spectacular view of the same surface in 3D surf TL ZE X The last script animex2 animates the time evolution of the numerical solution Under MATLAB be careful to make the graphic window visible and disjoint from the command window otherwise the command window will be raised and hide the animation The MATLAB animation code is simply T 1 nout CHAPTER 4 EXAMPLES for t T title_string sprintf Time d txoutstep plot X t ZE title title_string axis 0 120 Hcol 0 drawnow end The Octave code is nearly the same T 1 nout axis 0 120 Hcol 0 for t T title_string sprintf Time d txoutstep title title_string plot X t ZE end If the animation is too fast put the statement pause 1 somewhere in the loop 4 3 Example 3 Sensitivity studies 29 In this example the performance of the different numerical schemes from section 2 1 is tested The testing is done by the script runsens The testing is done by running the schemes with constant coefficients until steady s
37. ive an introduction to the theory of vertical egg distributions and the numerical method used The manual also has a chapter containing the reference manual a systematic description of the tools provided in VertEgg Chapter 1 Theory of Vertical Egg Distributions 1 1 The Equations Neglecting horizontal processes the evolution of the vertical distribution of a class of fish eggs is governed by a simple conservation principle The change in the number of eggs between two depth levels the number of eggs entering at the lower level the number of eggs leaving at the upper level 1 1 the number of eggs spawned the number of eggs that hatched or died To put this in a more mathematical formulation let the variable z denote depth and t time The z axis is chosen to point up that is z 0 at the surface and negative values are used in the water column This choice is opposite from Sundby 1983 1991 and Westgard 1989 The present choice is motivated by the most common axis convention in 3D hydrodynamic ocean modelling To make the theory more convenient mathematically a continuum approach is used where the eggs are replaced by a continuous egg concentration Let y y z t denote this egg concentration at depth z and time t Let F F z t be the upwards egg fluz i e the net number of eggs passing upwards per time unit at depth z and time t Similarly let Q Q z t denote the source term the number of eggs spawned minus the
38. ivity ins 4 W Terminal velocity ms nstep Number of integration steps dt Time step s P opt Spawning term eggs m s alpha opt Loss coefficient 1 s CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 51 AO lives at the egg points size AO Ncell x 1 K and W live at the flux points size Ncell 1 x1 If P and alpha are present they also live at the egg points If P and alpha are missing the source term is ignored Output A Result concentration eggs m A lives at egg points in the same way as AO Description Integrates the convection diffusion equation by the flux limited method Starting with the concentration in AO nstep integration steps are performed The result is saved in A ftcs Numerical integration of transport equation Usage A ftcs A0 K W nstep dt P alpha Input AO Start concentration eggs m K Eddy diffusivity m s7 W Terminal velocity ms nstep Number of integration steps dt Time step s P opt Spawning term eggs m s alpha opt Loss coefficient 1 s AO lives at the egg points size AO Ncell x 1 K and W live at the flux points size Ncell 1 x1 If P and alpha are present they also live at the egg points If P and alpha are missing the source term is ignored Output A Result concentration eggs m A lives at egg points in the same way as AO Description Integrates the convection diffusion equation by the forward time centr
39. lux points Output A Stationary solution eggs m A lives at the egg points size Ncell x 1 Description Computes the steady state solution of the convection diffusion equation without source term with eddy diffusivity K and egg velocity W variable in the water column The solution is computed by viewing K and W as piecewise constant on the grid cells upstream Numerical integration of transport equation Usage A upstream AO K W nstep dt P alpha CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 54 Input AO Start concentration eggs m K Eddy diffusivity m s 1 W Terminal velocity ms nstep Number of integration steps dt Time step s P opt Spawning term eggs m s alpha opt Loss coefficient 1 s AO lives at the egg points size AO Ncell x 1 K and W live at the flux points size Ncell 1 x1 If P and alpha are present they also live at the egg points If P and alpha are missing the source term is ignored Output A Result concentration eggs m A lives at egg points in the same way as AO Description Integrates the convection diffusion equation by the upstream method Starting with the concentration AO nstep integration steps are performed The result is saved in A ve_drint Integrate over a depth range Usage int ve_drint A z1 z2 Input A Egg distribution eges m z1 First integration limit m z2 Second integration limit m A m
40. nation the schemes use simple on off mechanisms to switch between the Lax Wendroff and upstream fluxes On the other hand the asymmetry above is exploited The schemes have high accuracy at maxima because the unmodified Lax Wendroff flux is used in this situation The positive method This is a simple scheme mostly using the Lax Wendroff fluxes but limiting to the upstream fluxes where Lax Wendroff produces negative concentration values The algorithm consists of three steps CHAPTER 2 NUMERICAL METHODS 18 1 Compute the Lax Wendroff fluxes including diffusivity by formulee 2 21 and 2 11 2 Apply the fluxes to compute a test distribution At bes i F F p Yi p a 1 3 Where yt lt 0 recompute F and F _ by the upstream formulation 2 29 and diffusion 2 11 Positivity of the upstream scheme or Lax Wendroff scheme implies positivity of the flux limited scheme The positivity condition 2 33 is therefore a sufficient but not necessary condition for positivity of the combined scheme The scheme is implemented in the toolbox as the function posmet The minimum limiting method Although the method above is positive it may create wiggles around a positive value To improve on this situation a slight variant is proposed The new criteria for switching from Lax Wendroff to upstream flux is the occurrence of a local minimum As the first negative value must be a local minimum prevents the method from creating neg
41. numbers that hatched or died per depth and time unit at depth z and time t The source term can also be used to take care of other processes such as loss of eggs by horizontal advection The conservation principle 1 1 can then be formulated in integral form Z2 Z2 t2 t2 t2 Ze f ete f eletiyds Fandt Pleat at l Q z t dzdt z z ty ty ti YZ 1 2 CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS 5 Mathematically this can be reformulated in mixed form differential in time and integral in space o T olc t de F z t Flani f Q z t dz for H lt z1 lt z2 lt 0 1 3 or in pure differential form Op OF A te 1 4 eee ae ae The flux is decomposed in two parts the convective flux and the diffusive flux The convection is due to the terminal buoyant velocity w w z t of the egg which is computed by the density difference from the surroundings and the egg size as described in section 1 3 The formulation is simply FY wg 1 5 The diffusion is caused by turbulent mixing and is modelled by Fick s law using the vertical eddy diffusion K K z t Oy df KZ 1 F 1 6 Often the source term Q can be separated in a spawning or production term independent of the egg concentration Qeon p 1 7 and a mortality or loss term depending on the concentration Qh ap 1 8 Using this the differential conservation law 1 4 becomes Op o 0 _ 09 bE RPE L a TUA aE ap 1 9 This paraboli
42. ommand plot A ZE a nicer plot as shown in figure 4 1 is made under MATLAB by the sequence plot A ZE title Stationary solution xlabel Concentration eggs m 3 ylabel Depth m under Octave the plot command terminates the sequence title Stationary solution xlabel Concentration eggs m 3 ylabel Depth m plot A ZE CHAPTER 4 EXAMPLES 25 Stationary solution Depth m 60 J L L L 0 10 20 30 40 50 60 70 80 90 100 Concentration eggs m Figure 4 1 Steady state solution with constant coefficients and no source terms The script srcsamp1 demonstrates the exact solution srcsact with source terms Using the same values of K and W and spawning rate 1 egg m day and mortality of 5 per hour The mortality rate alpha is computed by exp aAt 1 0 05 The integrated steady state concentration in this case is a P H 81 2 eggs m The solution is computed by the following code segment K 0 01 W 0 001 P 1 24 3600 alpha log 0 95 3600 A srcsact K W P alpha The steady state solution A is depicted in figure 4 2 The main difference from the nosource situation is that the concentration stays well above zero except very close to the bottom where no eggs come up from below 4 2 Example 2 Transient solution with constant co efficients This example demonstrates the use of ftcs lwendrof or upstream and flux1im for solving
43. ompared in figure 4 16 The transient solution have a slightly higher peak consentration The script plotres is used for postprocessing the results for all 5 egg groups In this case the columns in X hold the sum of the 5 concentrations every 12 hour Figure 4 17 show the distributions for the 5 egg groups after the 10 days of simulation The solution is a narrow peak for each egg group at their equilibrium salinity The next figure 4 18 show the time evolution of the mean depth of the distributions Note that although the distance is shorter the heaviest eggs use longer time to raise to their equilibrium depth This confirms unpublished calculations by S Sundby 4 7 Example 7 Halibut eggs Monte Carlo simulation Under construction In nature egg diameters and densities are not constant or confined to a handful of discrete groups To explore this further it is assumed that these properties have known statistical distributions The paper Haug et al 1984 does not identify the distributions but give ranges for the values For the egg diameter a normal distribution with mean CHAPTER 4 EXAMPLES 43 Daily egg distributions 0 T T 100 F N 200 300 Depth m 400 500 1 L 0 0 5 1 1 5 2 2 5 Egg concentration eggs m gt 600 we 3 5 4 45 Figure 4 15 Daily egg distributions from egg group 3 Final distribution against steady state solution Depth Im f
44. p 5 a BpAzt sat B enAP B 18 For consistence F must converge to the flux function F FoF wy Kgy asAz At 0 B 19 This gives the following consistence criterion a PBp gt w asAt Az 0 B 20 a B Az 2K as At z gt 0 B 21 The schemes considered in section 2 1 1 should be consistent by construction This is easily verified as w a in all three cases and 2K FTCS a B Az 4 2K w At Lax Wendroff B 22 2K w Az Upstream B 2 2 Conditions for positivity and stability For this analysis the nondimensional form Az f Ty avi bipi_1 B 23 of the numeric flux function is used APPENDIX B MATHEMATICAL DIGRESSIONS 63 Substituting equation B 23 and the boundary conditions F Fy 0 in B 14 gives the following expession for the solution yt at the next time step pi 1 be p1 aap B 24 Pi bipi 1 1 a bi41 Pi aii t 2 N 1 B 25 yy buyn 1 an on B 26 For the scheme to be positive we must have yf gt 0 for all nonnegative values of Yi 1 i Pi 1 In other words the coefficients above must all be nonnegative aj gt 0 i 2 N B 27 b lt 0 i 2 N B 28 Shae Te B 29 Gee FED N HA B 30 an lt 1 B 31 If the coefficients a and b are constant a traditional Von Neumann stability analysis can be carried out The amplification factor is A 1 a b cos i a b sin O B 32 for mr Az The stability
45. pawn M Z Input M Vertical integrated concentration eggs m Z Spawning depth m M and Z are scalars Output A Egg distribution eges m A is a column vector living at the egg points Description Returns a vertical egg distribution A with vertical integral M concentrated as much as possible around depth Z If ZE Ncell lt Z lt ZE 1 then Z ve_mean A CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 53 srcsact Stationary solution const coeff source term Usage A srcsact K W P alpha Z Input K Eddy diffusivity m a W Terminal velocity ms P Egg production ae m s alpha Egg loss rate 1 s Z opt Vertical coordinate m K W P and alpha are scalars Z can be an arbitrary array If Z is ommitted ZE is used as vertical coordinate Output A Concentration at depth Z eges m If Z is present size Y size Z otherwise size Y size ZE Description Computes the exact stationary solution of the convection diffusion equation with constant eddy diffusivity K velocity W egg production P and loss rate alpha If Z is present returns array of pointwise values If Z is not present returns exact cell averages sstate Steady state solution Usage A sstate M K W Input M Vertical integrated concentration eggs m K Eddy diffusivity m s 7 W Egg velocity ms 1 M is scalar K and W are column vectors of length Ncell 1 K and W live at the f
46. s for W and Re are made by the following commands CHAPTER 4 EXAMPLES 35 Terminal velocity at different density differences Velocity mm s N a T L L L L L J 0 0 5 1 1 5 2 2 5 3 3 5 4 4 5 5 Diameter mm Figure 4 8 Terminal velocity for different density differences d 0 0 1 4 mm drho 0 0 2 6 kg m 3 dtab ones size drho d 1000 d constant in colums drhotab drho ones size d drho constant in rows W Re eggvel drhotab dtab The contour plot is made by cl 0 1 0 1 0 5 1 0 0 5 3 0 4 0 9 0 Contour levels c contour d drho 1000 W cl g clabel c Add the same lines Re 0 5 and Re 5 0 in red as above hold on cl 0 5 5 0 contour d drho Re cl r hold off A 3D view of the velocity surface can also be plotted surf d drho 1000 W Systems like MATLAB and Octave are well suited for fitting functions to data The script visklsq demonstrates how to fit a polynomial quadratic in T and linear in S to CHAPTER 4 EXAMPLES 36 Terminal egg velocity mm s T A T wo T Density difference kg m N T T 0 0 5 1 1 5 2 2 5 3 3 5 4 Diameter mm Figure 4 9 Terminal velocity contours table 1 1 by the method of least squares Some array manipulation must first be done to obtain three column vectors SI TI and B with corresponding values of salinity temperature and viscosity
47. s result is depicted in Fig 4 10 With non constant coefficients the function sstate must be used to calculate the sta tionary solution Y1 sstate M1 K W1 Y2 sstate M2 K W2 Y Y1 Y2 CHAPTER 4 EXAMPLES 39 Adding this to the previous figure gives Fig 4 11 plot Y ZE 7 e fe Initial distribution 7 Distribution after 12 hours 10 Stationary distribution l 20 F F l l 30 F I 40H i E l 50 F 2 Ko f a 60 70 l l 80 F 1 l ii 90 F 1 b 100 7 L L L L L T J 0 2 4 6 8 10 12 14 Concentration eggs m gt Figure 4 11 Initial 12 hour and stationary limit solution In addition plotex5 and animex5 show more details on the time evolution For this example the steady state solution is reached after approximately 80 hours 4 6 Example 6 Halibut eggs the transient problem In this and the next two examples eggs of Atlantic halibut Hippoglossus hippoglossus will be considered in deeps fjords in northern Norway Data on egg diameter and egg salinity are taken from Haug et al 1984 Synthetic vertical profiles representative for the area of temperature salinity and vertical mixing have been constructed by S Sundby pers comm This example goes further towards developing a model application from VertEgg The main script runex6 is initiated from the set up file runex6 sup The physical setting and initial egg distribution are also re
48. solution is of interest If the coefficients w and K are constant the exact solution 1 21 can be used directly With negative velocity and low diffusivity m w K lt 0 the formula may overflow This can be avoided by using the symmetry relation 1 22 for negative m This solution is computed by the function eggsact in the toolbox For the discretized solution to have the correct vertical integral and be comparable to the numerical solutions cell averages 60 Qi 2 eit Pi Az pegan 2 44 are better This is also computed by eggsact General w and K can be regarded as constant on the grid cells Suppose w and K and their quotient m live on the flux points as in the transient problem Form the cell average Mi Mi mj41 2 The cell averaged solution becomes C emir _ e i i 1 pi 2 45 where the C s are computed by continuity pilzi pilzi 1 2 46 and vertical integral N Az g 2 47 i 1 CHAPTER 2 NUMERICAL METHODS 20 With low mixing and high sinking velocity the exponential terms may overflow The computation of the C terms may overflow The last problem is overcome by working with the logarithms For the first problem the C terms are renormalised by finding a suitable value for C1 The method is implemented in the toolbox as the function sstate Chapter 3 Working in the MATLAB Octave Environment MATLAB and Octave offer command line oriented interactive environments for numerical computations
49. stributed between 500 and 600m depth The model is run with space step Az 5m and time step At 10 minutes as above 5 egg groups are used all with diameter 3 2mm but the neutral salinity vary from 34 3 to 34 7 psu in steps of 0 1 The simulation time is 10 days and the results are written to file every 12 hours The first post processing script plotgrp3 concentrates on egg group 3 which is neutral at salinity 34 5 psu The model output file result dat is read and the egg profile data every 24 hour starting with the initial distribution is stored in the array X3 The command plot X3 ZE CHAPTER 4 EXAMPLES 42 Courant number Diffusive parameter Cell Peclet number T 0 T 100 F 4 100 q 100 200 4 200 4 200 E m 300 4 300 4 300 KOJ A 400 F 4 400 400 500 F 4 500 500 600 4 600 i 600 1 0 1 0 0 2 0 4 0 20 40 Figure 4 14 Vertical profiles of Courant number diffusive parameter and cell Peclet num ber plots these daily distributions in fig 4 15 The numerics seems to be working the distri butions do not contain negative values and the eggs are moving upwards a little less then 100 m per day without too much smoothing of the distribution After 5 6 days the distri bution has reached it equilibrium level and start to concentrate at this level After the 10 days the transient solution is very similar to the stationary solutions These solutions are c
50. tEgg software and or this report should be refered to when publishing results obtained by the use of VertEgg A 2 Matlab under Microsoft Windows Matlab is a commercial product of The MathWorks Inc The official web page is http www mathworks com Matlab is available for PC Macintosh and UNIX workstations Vertegg has been developed and tested on version 4 2c 1 on PCs running Windows 3 11 and Windows 95 The VertEgg toolbox consist of two directories the toolbox and the example direc tory The toolbox directory can be placed anywhere but a natural place is C MATLAB TOOLBOX LOCAL VERTEGG Matlab must be told about the location of the toolbox This is best done by adding the the directory to the matlabpath in the master startup file C MATLAB MATLABRC M or your own startup file Alternatively the directory can be added by the path command in an interactive session The examples directory is not required and can be placed anywhere 58 APPENDIX A INSTALLATION 59 A 3 Octave under UNIX A short description of Octave is taken from the README file Octave is a high level language primarily intended for numerical computa tions It provides a convenient command line interface for solving linear and nonlinear problems numerically Octave is free software you can redistribute it and or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation Octave is developed by J W Eaton from t
51. tate and thereafter comparing with the exact solution computed by eggsact The parameters that are varied are the eddy diffusion coefficient K the vertical velocity w the space step dz and the time step dt These are defined near the start of the file runsens nm Diffusion coefficient m 2 s KO 0 01 Vertical velocity m s WO 0 001 h Space step m dzO 2 Time step s dt 120 These values are the same as in example 2 The other defining variables are H 100 Depth m simtime 72 Simulation time hours MO 1000 Vertical integral of concentration eggs m 2 CHAPTER 4 EXAMPLES 30 From example 2 it is evident that the result after 72 hours is close to the steady state limit All eggs are released at depth 50 m After initialising VertEgg the characteristic numbers are computed C WO dt dz S KO dt dz dz Pcell abs C S they are printed nicely in the command window by the C style output function fprintf The number of timesteps is nstep simtime 3600 dt Number of steps Testing the first scheme is done by tic Reset clock A ftcs A0 K W nstep dt tid 1 toc Save elapsed time X 1 A Put solution as first column in X and similar for the other three methods The timing was done on a PC with an INTEL 486 processor running at 66 MHz The exact solution and some of it properties is computed by B eggsact MO KO WO Bmean ve_mean B Bstd ve_std B
52. tegral eges m If A is a matrix of size Ncell x n Mis a row vector of length n Description Computes the vertical integral of an egg distribution ve_int is a vector function ve_mean Mean depth of an egg distribution Usage mu ve_mean A Input A Egg distribution eges m A must be a matrix where the columns live on egg points but a row vector at egg points is also accepted size A Ncell x n or 1 x Ncell CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 56 Output mu The center of gravity m If A is a matrix of size Ncell x n mu is a row vector of length n Description Computes the mean or center of gravity of the egg egg distribution A ve_ mean is a vector function ve_rand Make random egg distribution Usage Y ve_rand M Input M Vertical integrated concentration eggs m M is a scalar Output Y Random egg distribution eges m Y is vector of size Ncell 1 Description A uniform distribution is used to generate random values between 0 and 1 The values are scaled to make ve_int Y M ve_rmsd Root mean square deviation Usage R ve_rmsd X Y Input X Egg concentration eges m Y Egg concentration eges m X and Y may be matrixes of the same size with Ncell rows X and or Y may also be vectors of length Nce11 Output R Root mean square deviation eggs m R is a row vector with length max columns X columns Y Description Computes
53. the general steady state solu tion More details of the implementation is given in section 2 2 Linear coefficients In Sundby 1991 the solution is derived for m linear Let m be given as m z a z 20 Then M z a z zo z Taking the last term into the constant C the solution becomes p z Cer 1 32 Bathypelagic eggs are neutral buoyant at z zo raising if deeper and sinking if higher in the water column In this case the coefficient a is negative and the concentration has a normal distribution about z z with variance o 1 al Stationary solution with source terms With source terms the steady state equation is Op Lae Ue as as This is a general second order ordinary differential equation With constant coefficients the equation becomes P ag 1 33 Ko wy ag P 1 34 and the no flux boundary conditions are K wyp 2 0 2 H 1 35 The solution can be written P z Ae Be z 1 36 with EE E E 1 37 a zg VY ak w 1 b zg V 4a K w 1 38 Poje V 2 1 39 abK 1 e7 0 b H wP y 1 eE aak 1 e CHH giao CHAPTER 1 THEORY OF VERTICAL EGG DISTRIBUTIONS 10 This function is computed in the toolbox by the function srcsact The signs are chosen such that positive velocity w makes all terms positive For negative velocities a symmetry property similar to equation 1 22 can be used if y z is a solution
54. the root mean square deviation R between the columns of X and Y If one argument is a vector it is compared to all columns of the other argument If X and Y are matrices 1 he aa eer rear RC Jen LOOP KED 1 If Y is a vector 1 roa T ET R j ioe YOGA Y i i CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 57 ve_std Standard deviation of egg distribution Usage s ve_std A Input A Egg distribution eges m A must be a matrix where the columns live on egg points but a row vector at egg points is also accepted size A Ncell x n or 1 x Ncell Output s The standard deviation m If A is a matrix of size Ncell x n s is a row vector of length n Description Computes the standard deviation of an egg distribution A ve_std is a vector function Appendix A Installation A 1 Availability of the software In the spirit of free exchange of scientific ideas the VertEgg toolbox is free software The software is available by anonymous ftp from the cite ftp imr no in the directory pub software VertEgg The software can be freely redistributed and modified the only restriction is that it can not be included in commercial or shareware software The author and the Institute of Marine Research can of course not give any guarantie that VertEgg behaves as it should If you download and in particular if you use VertEgg the author would like to be informed Use e mail bjorn imr no The Ver
55. the script visklsq which performs the least squares regression used to derive formula 1 47 for the dynamic molecular viscosity First some necessary constant are defined mu 1 6e 3 Dynamic molecular viscosity g 9 81 Acceleration due to gravity rho 1027 Density of sea water then the maximum egg diameter Dmax for application of Stokes formula can be plotted drho 0 1 0 1 5 Range of density differences Dmax 9 mu 2 rho g drho 7 1 3 plot drho Dmax 1000 Use mm as unit As a verification of the implementation of the formulas in eggvel figure 1 from Sundby 1983 will be reproduced d 0 0 1 5 Range of diameters in mm hold on axis 0 5 0 5 for drho 0 25 0 5 1 6 The values of drho used by Sundby W eggvel drho ones size d d 1000 mu plot d W 1000 g end The expression drho xones size d is required to make drho into an array of the same shape as d as required by eggvel The factors 1000 converts between mm and m The lines Re 0 5 and Re 5 0 are added in red colour This figure is shown as fig 4 8 d i 1 Remove d 1 to prevent division by zero W 0 5 mu rho d 1000 W 1000 W Convert to mm s hold on plot d W r Re 0 5 plot d 10 W r Re 5 0 hold off Another way of visualizing the eggvel function is to make a table and make a contour plot of it The rest of this example is for MATLAB only Table
56. tionary solution in the case of constant eddy diffusivity and egg velocity with or without source terms It also demonstrates how to make a simple vertical profile in both systems The script eggsampl demonstrates the use of eggsact First the vertical integrated concentration M 100 eggs m the eddy diffusivity K 0 01m s and the egg velocity W 1mm s must be defined M 100 K 0 01 W 0 001 The depth of the water column Hcol is set to 100 m and a vertical grid size dz of 1 m is chosen ve_init ve_grid 100 1 23 CHAPTER 4 EXAMPLES 24 With four arguments the function eggsact M K W Z computes the solution 1 21 at a given depth level Z Note that both positive and negative values can be used for the depth eggsact M K W Z eggsact M K W Z With three arguments eggsact computes the cell averages of the solution A eggsact M K W The toolbox contains functions that compute the integral mean depth and standard devi ation of A ve_int A ans 100 0 ve_mean A ans 9 9975 ve_std A ans 9 9773 By construction the integral is correct Using formulas 1 27 and 1 28 the correct values for the mean and standard deviation are computed by m W K mean 1 m H exp m Hcol 1 mean 9 9955 var 2 exp m Hcol m 2 Hcol 2 2 m Hcol 2 m 2 1 exp m Hcol mean 2 std sqrt var std 9 9773 The profile of the egg distribution A can be plotted by the c
57. tream scheme gives a lower peak at the surface and too high concentrations below 10 m Figure 4 5 plots the error that is the diffence between the numerical solution and the exact solution As Lax Wendroff is positive the flux limited method produce the same solution The FTCS scheme slightly overshoots the surface value while Lax Wendroff undershoots even more slightly The table for this run is table 4 1 below RMSE E mean E std CPU time ftes 0 050 0 029 0 026 8 7 lwendrof 0 044 0 030 0 034 8 5 upstream 1 421 0 965 0 951 8 6 fluxlim 0 044 0 030 0 034 11 8 Table 4 1 Results from reference run The other class of tests is meant to be typical of sinking eggs Here the eddy diffusivity is 5 per cent of the above K 0 0005m s and w 0 001ms To plot the exact solution for a subrange of the water column an index array is used B eggsact MO KO WO CHAPTER 4 EXAMPLES 32 Computational stationary solution T T i p T T T ftes Iwendrof 10 upstream H minlim Depth m 00 L 1 pes L 250 200 150 100 50 0 50 100 150 200 Egg concentration eggs m Figure 4 5 The errors in the numerical stationary solutions above II 41 50 plot B II SE II This figure is given as figure 4 6 The corresponding numerical solutions dz 2 m dt 120s are shown in figure 4 7 Both the FTCS and the Lax Wendroff scheme have pro
58. tribution has been developed by Sundby 1983 Westgard 1989 developed two numerical models for the time evolution of the concentration These models are written in FORTRAN and use the GPGS library for graphics The commercial software system Matlab and the free alternative Octave provide inter active command line environments for numerical computations and visualisation VertEgg is a toolbox for scientific work on vertical egg distributions in these environments It contains tools for analysing observed distributions and performing numerical simulations including pre and post processing of the results VertEgg is not a finished application the tools are intended to be used interactively or sewed together by the user to make the appli cation that solves her problem This approach should give the competent user a powerful and flexible environment for research on vertical distributions The author believes strongly in learning by problem solving and examples Therefore the main part of the manual is the example chapter The examples ranges from simple illustrations of the functions in the toolbox by verification and sensitivity studies to a ready to run egg distribution model complete with file I O These examples are also avail able online as scripts programs in the internal programming language of the packages The recommended way to make small applications is to take the closest example script and try out modifications The first two chapters g
59. ure The density is computed by the international equation of state for sea water UNESCO 1980 eggmom Moment of egg distribution Usage M eggmom A p CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 49 Input A Egg distribution eges m p Order of moment A must be a matrix where the columns live on egg points but a row vector at egg points is also accepted size A Ncell x n or 1 x Ncell Output M The p th moment of A leggs m If Ais a matrix of size Ncell x n M becomes a row vector of length n containing the moments of the columns of A p must not be negative Description Computes the p th moment of the egg distribution A 0 u 2Pa z dz H where a z is the piecewise constant function a z A i for ZF i 1 lt z lt ZF i If A is a matrix the moments of the columns are calculated eggsact Exact stationary solution const coeff Usage A eggsact M K W Z Input M Vertical integrated concentration eggs m K Eddy diffusivity m s 1 W Terminal velocity ms 1 Z opt Vertical coordinate m M K W are scalars Z can be arbitrary array IF Z is omitted ZE is used as vertical coordinates Output A Concentration at depth Z eges m If Z is present size A size Z otherwise size A size ZE Description Computes the exact stationary solution of the convection diffusion equation with constant eddy diffusivity K and velocity W If Z is present
60. uring vertical integration Without source term the total concentration is conserved Therefore the local concen tration values can not become arbitrary large unless there are negative values in some other cells In other words positivity is a sufficient but not necessary condition for stability of such schemes In the following several methods are described They are implemented in the toolbox as ftcs lwendrof upstream posmet and minlim respectively Their performance will be studied in the example section 4 3 Several methods for the same problem causes a new problem which method to choose This depends on the range of P values in the problem A general advice is to try Lax Wendroff first This is an accurate and fast method when applicable If oscillations occur go for the flux limited methods or use higher spatial resolution In both cases more computing time is required 2 1 1 Linear conservative schemes The linear conservative schemes considered here estimates the total flux function in the form F aifi Gpi r 2 8 where the a s and 3 s are independent of the y s Sometimes this will be used in non dimensional form Az F Ty uiPi biyi 1 2 9 Some general theory for this kind of numerical schemes is presented in Appendix B 2 The FTCS scheme The simplest scheme is often called FTCS forward time central space after the differenc ing This scheme is described for instance in chapter 9 4 in Fletcher
61. ust be a matrix where the columns are egg distributions But a row vector can also be accepted size A Ncell x n or 1 x Ncell Output int Integral of A over depth range eges m If A is a matrix of size Ncell x m int becomes a row vector of length m con taining the integrals of the columns of A Description Computes the vertical integral Z2 int f a z dz Zz 1 where a z is the piecewice constant function a z A i for ZF it1 lt z lt ZF i If Ais a matrix the integral is computed for each column ve_grid Set up vertical grid CHAPTER 5 REFERENCE MANUAL VERTEGG VERSION 0 9 55 Usage ve_grid H dz0 BE Input H Depth of water column dzo Grid size Output None Description Sets up the vertical grid used in VertEgg given the depth H of the water column and the grid size dzO Re defines all global variables The global variables are declared by ve_init ve_init Initialize VertEge Usage ve_init Input none Output none Description Script for initializing VertEgg Declares the global variables so they become available in the workspace The actual values are set by ve_grid ve_int Vertical integral of egg distribution Usage M ve_int A Input A Egg distribution eges m A must be a matrix where the columns live on egg points but a row vector at egg points is also accepted size A Ncell x n or 1 x Ncell Output M The vertical in
62. y will be found by Octave The examples directory can be placed anywhere Appendix B Mathematical digressions B 1 Exact solution of transient problem with constant coefficients If the eddy diffusivity K and the egg velocity w are constant and the source term Q is zero the convection diffusion equation 1 4 can be solved analytically The problem is p wP Kp 0 B 1 with boundary conditions wp Ky 0 z H z 0 B 2 Using a standard technique separation of variables let y z t A t B z With m w K this gives the following ordinary differential equation for B B mB AB 0 B 3 or in Sturm Liouville form ec B Ae B 0 B 4 The boundary conditions are separated B mB z H z 0 B 5 In this form we have a self adjoint regular Sturm Liouville system To such a system there is an increasing sequence of real eigenvalues Aj lt Ay lt with associated eigenfunctions B z These functions forms an orthogonal system with respect to the inner product Fg f Fale dz B 6 60 APPENDIX B MATHEMATICAL DIGRESSIONS 61 In our case the only eigenvalue lt m 4 is Ay 0 corresponding to the stationary solution y z t e For gt m 4 let a A m 4 The general solution to equation B 3 is then B z 2 b cos z be sin az B 7 Imposing the boundary conditions gives 2ab mb and a a el eee B 8 The normalised eigenfunctions with respe

Download Pdf Manuals

image

Related Search

Related Contents

MANUAL DE INSTALAÇÃO Clique aqui e faça o download.  Manual de Usuario  AT&T E5934B User's Manual    Intellinet 351911 cable network tester  

Copyright © All rights reserved.
Failed to retrieve file