Inflow-Outflow options for reservoirs
Inflow-Outflow options for reservoirs
Hi All,
I am trying to use ROMS to model the hydrodynamics of a small reservoir (about 10 million cubic meters, and about 8 m deep).
I am trying to model the inflow and outflow as provided below, but for some reason, which I do not understand, I receive wrong results - water volume doesn't change.
Any help/suggestion will be greately appreciated.
Thanks, Dmitry
In the SET TRACERS AND/OR MASS POINT part of the analytical.F file I defined inflow and outflow points:
elif defined My_Model
Nsrc=2
Dsrc(Nsrc-1)=0.0_r8 ! first point - inflow
Isrc(Nsrc-1)=115
Jsrc(Nsrc-1)=110
.........................
Dsrc(Nsrc)=1.0_r8 ! second point - outflow
Isrc(Nsrc)=25
Jsrc(Nsrc)=25
.........................
In VERTICALLY INTEGRATED MASS TRANSPORT part of the analytical.F file I define next options for the inflow and outflow:
elif defined My_Model
IF (is .eq. Nsrc-1) THEN ! first point -inflow
fac=-1.0_r8
Qbar=fac*1.0_r8
ELSE !second point - outflow
fac=-1.0_r8
Qbar=fac*5.0_r8
END IF
I am trying to use ROMS to model the hydrodynamics of a small reservoir (about 10 million cubic meters, and about 8 m deep).
I am trying to model the inflow and outflow as provided below, but for some reason, which I do not understand, I receive wrong results - water volume doesn't change.
Any help/suggestion will be greately appreciated.
Thanks, Dmitry
In the SET TRACERS AND/OR MASS POINT part of the analytical.F file I defined inflow and outflow points:
elif defined My_Model
Nsrc=2
Dsrc(Nsrc-1)=0.0_r8 ! first point - inflow
Isrc(Nsrc-1)=115
Jsrc(Nsrc-1)=110
.........................
Dsrc(Nsrc)=1.0_r8 ! second point - outflow
Isrc(Nsrc)=25
Jsrc(Nsrc)=25
.........................
In VERTICALLY INTEGRATED MASS TRANSPORT part of the analytical.F file I define next options for the inflow and outflow:
elif defined My_Model
IF (is .eq. Nsrc-1) THEN ! first point -inflow
fac=-1.0_r8
Qbar=fac*1.0_r8
ELSE !second point - outflow
fac=-1.0_r8
Qbar=fac*5.0_r8
END IF
ROMS can handle multiple inflow points. This smells like a subtle coding error.
My biggest errors in trying to specify point sources in ROMS have occurred because I calculated the positions in matlab, and did not properly take into account the fact that for array start in fortran at index 0 are offset in matlab by 1 -- e.g. a point in ROMS on the rho grid at [3,3] is at [4,4] in matlab. Could you be doing something similar?
If you would like, I can send you code that specifies inflow in a forcing file created by matlab. I have never used analytical.F to specify inflow.
Jamie
My biggest errors in trying to specify point sources in ROMS have occurred because I calculated the positions in matlab, and did not properly take into account the fact that for array start in fortran at index 0 are offset in matlab by 1 -- e.g. a point in ROMS on the rho grid at [3,3] is at [4,4] in matlab. Could you be doing something similar?
If you would like, I can send you code that specifies inflow in a forcing file created by matlab. I have never used analytical.F to specify inflow.
Jamie
Another thing to try is to move the points one further into the interior in analytical.F. Since this specifies the transport on a cell face, you will see your flux as a source of bouyancy on one side of the source, and a sink on the other. This will help you diagnose if the points are in the right place, and if they are going the right direction.
Is there any evidence from looking at the tracer solution that the sources are active at all?
If not, and you have placed the source on the domain perimeter, you need to think through the open boundary condition logic carefully lest the open boundary conditions overwrite your point source. With so many open boundary options I doubt we have tested all the possible ways they interact. Look at the open boundary f90 file to see what ROMS is actually doing, rather than what you think you asked it to.
The same holds true if the i,j index is shifted incorrectly with respect to the land/sea mask for interior points. Many of us have made this mistake. Care is required to identify whether i,j should correspond to the u,v or rho points grid, depending on which face of the cells you are trying to introduce the flow. Placing your source on the coast as defined by the interior land/sea mask will certainly avoid possible open boundary problems and many of us have used this successfully.
You can make the testing go a lot more quickly if you input the source locations through a forcing netcdf file, instead of analytical.F. This way you won't have to keep recompiling to test the effect of shifting i,j or changing the flow direction or strength.
John.
If not, and you have placed the source on the domain perimeter, you need to think through the open boundary condition logic carefully lest the open boundary conditions overwrite your point source. With so many open boundary options I doubt we have tested all the possible ways they interact. Look at the open boundary f90 file to see what ROMS is actually doing, rather than what you think you asked it to.
The same holds true if the i,j index is shifted incorrectly with respect to the land/sea mask for interior points. Many of us have made this mistake. Care is required to identify whether i,j should correspond to the u,v or rho points grid, depending on which face of the cells you are trying to introduce the flow. Placing your source on the coast as defined by the interior land/sea mask will certainly avoid possible open boundary problems and many of us have used this successfully.
You can make the testing go a lot more quickly if you input the source locations through a forcing netcdf file, instead of analytical.F. This way you won't have to keep recompiling to test the effect of shifting i,j or changing the flow direction or strength.
John.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
Try setting the point source to the middle of the grid, and ramping up the discharge so it is easy to see. Although not realistic, it allows you to make sure it is being set at the exact location you think, and is being discharged through the correct grid cell face (correct direction). Then, simply move it towards the location you want it specified at. If it never shows up that narrows the problem.
Dmitry-
I would be happy to, but I cannot find your email address. You can find my contact info at my web page, http://oxbow.sr.unh.edu .
Cheers,
Jamie
I would be happy to, but I cannot find your email address. You can find my contact info at my web page, http://oxbow.sr.unh.edu .
Cheers,
Jamie
Re: Inflow-Outflow options for reservoirs
Hi Dmitry,
Your setup is wrong.
"Dsrc" shows the direction of the point source whether it is in x-dir or in y-dir, but not whether it is into the field or out of the field.
To tell ROMS that your point source will be into the field you need to specify Qbar to be positive or negative.
So change your setup as follows:
elif defined My_Model
Nsrc=2
Dsrc(Nsrc-1)=1.0_r8 ! first point - in x -direction
Isrc(Nsrc-1)=115
Jsrc(Nsrc-1)=110
.........................
Dsrc(Nsrc)=1.0_r8 ! second point - in x-direction
Isrc(Nsrc)=25
Jsrc(Nsrc)=25
.........................
In VERTICALLY INTEGRATED MASS TRANSPORT part of the analytical.F file:
elif defined My_Model
IF (is .eq. Nsrc-1) THEN ! first point -inflow
fac=1.0_r8 ! positive Qbar inflow!
Qbar=fac*1.0_r8
ELSE !second point - outflow
fac=-1.0_r8 !negative Qbar outflow!
Qbar=fac*5.0_r8
END IF
Ezgi
Your setup is wrong.
"Dsrc" shows the direction of the point source whether it is in x-dir or in y-dir, but not whether it is into the field or out of the field.
To tell ROMS that your point source will be into the field you need to specify Qbar to be positive or negative.
So change your setup as follows:
elif defined My_Model
Nsrc=2
Dsrc(Nsrc-1)=1.0_r8 ! first point - in x -direction
Isrc(Nsrc-1)=115
Jsrc(Nsrc-1)=110
.........................
Dsrc(Nsrc)=1.0_r8 ! second point - in x-direction
Isrc(Nsrc)=25
Jsrc(Nsrc)=25
.........................
In VERTICALLY INTEGRATED MASS TRANSPORT part of the analytical.F file:
elif defined My_Model
IF (is .eq. Nsrc-1) THEN ! first point -inflow
fac=1.0_r8 ! positive Qbar inflow!
Qbar=fac*1.0_r8
ELSE !second point - outflow
fac=-1.0_r8 !negative Qbar outflow!
Qbar=fac*5.0_r8
END IF
Ezgi