campreilly / UnderSeaModelingLibrary

The Under Sea Modeling Library (USML) is a collection of C++ software development modules for sonar modeling and simulation.
Other
45 stars 22 forks source link

Sound speed derviative error using profile_grid_fast in florida_straits study #241

Open campreilly opened 9 years ago

campreilly commented 9 years ago

Modeling cross-slope refraction from florida straight area.

Experience zones at which the ray path seems to go horizontal. This is not physically realistic.

Side view in demo_gui shown below. Problem seems to occur at 13.48 seconds, DE=+4 deg, AZ=+8 deg.

capture

campreilly commented 9 years ago

Problem seems to happen around 13.5 sec into run capture2

campreilly commented 9 years ago

Problem does not seem to happen when WOA profile is used. capture

campreilly commented 9 years ago

The problem appears to be that there are high frequency variations in the •Realistic 3-D SVP from Ballard's data that look like tiny ducts to the WaveQ3D refraction code. Here is the gradient of a single sound speed profile, as a function of depth, near lat/long 26.2031 -79.9631.

capture3

Here is a section of individual samples

capture4

campreilly commented 9 years ago

The high frequency variations in the Realistic 3-D SVP from Ballard's data might be a "red herring".

When we break into the WaveQ3D code, we see that dc/dr varies in sign along these straight paths. So the model thinks that it is stuck in a tiny duct. This only effect paths that are nearly horizontal when they encounter the duct, which makes them more prevalent at low D/E launch angles.

But in order for the gradient variation shown in this issue to cause this problem, they would have to be large enough to change sign, and none of them do in the area where the problems are occurring. It is much more likely that there is a problem with the way that we are writing these profiles to disk in the Matlab code. This would cause the WaveQ3D model to see a very different environment that seen in Matlab.

campreilly commented 9 years ago

This now appears to be a problem with profile_grid_fast or data_grid_svp. if we load the data as an un-fast profile, then all of the cd/dr values along this ray (+4 deg D/E, +8 deg AZ) are positive.

    netcdf_profile* grid = new netcdf_profile(
            profile_file, 0.0, -90.0, 90.0, -180.0, 180.0 ) ;
    grid->interp_type( 0, GRID_INTERP_PCHIP ) ;
    profile_model* profile = new profile_grid<double,3>(grid) ;

To Test this, we added some debugging code to wave_queue::step()

/**
 * Marches to the next integration step in the acoustic propagation.
 */
void wave_queue::step() {

    // search for caustics and boundary reflections

    detect_reflections() ;

    if ( time() > 13.0 ) {
        cout << time() << "\t"
                << _curr->position.latitude(1,1) << "\t"
                << _curr->position.longitude(1,1) << "\t"
                << _curr->position.altitude(1,1) << "\t"
                << _curr->sound_speed(1,1) << "\t"
                << _curr->sound_gradient.rho(1,1) << endl ;
    }

    // rotate wavefront queue to the next step.

    wave_front* save = _past ;

Which yields

capture5

Time Lat Long Alt Speed dc/dr
13.01 26.1952 -79.9643 -242.656 1497.12 0.145768
13.02 26.1954 -79.9642 -241.987 1497.23 0.163276
13.03 26.1955 -79.9642 -241.351 1497.33 0.145819
13.04 26.1956 -79.9642 -240.733 1497.41 0.134241
13.05 26.1958 -79.9642 -240.129 1497.49 0.124868
13.06 26.1959 -79.9642 -239.548 1497.56 0.100332
13.07 26.196 -79.9641 -238.983 1497.61 0.0838965
13.08 26.1962 -79.9641 -238.426 1497.65 0.0837841
13.09 26.1963 -79.9641 -237.882 1497.7 0.0825324
13.1 26.1964 -79.9641 -237.354 1497.74 0.0848317
13.11 26.1966 -79.9641 -236.836 1497.79 0.0969688
13.12 26.1967 -79.964 -236.332 1497.84 0.113064
13.13 26.1968 -79.964 -235.846 1497.91 0.119373
13.14 26.197 -79.964 -235.38 1497.96 0.116623
13.15 26.1971 -79.964 -234.93 1498.01 0.118945
13.16 26.1972 -79.964 -234.496 1498.06 0.126733
13.17 26.1974 -79.9639 -234.082 1498.12 0.141137
13.18 26.1975 -79.9639 -233.688 1498.18 0.151264
13.19 26.1976 -79.9639 -233.319 1498.24 0.159024
13.2 26.1978 -79.9639 -232.973 1498.29 0.162369

If we leave everything else the same and switch to profile_grid_fast with data_grid_svp, the dc/dr terms change sign.

    profile_model* profile = new profile_grid_fast(
            new data_grid_svp( new netcdf_profile(
                    profile_file, 0.0, -90.0, 90.0, -180.0, 180.0 ) ) ) ;

capture5

Time Lat Long Alt Speed dc/dr
13.01 26.1963 -79.9641 -210.102 1502.39 0.0949528
13.02 26.1964 -79.9641 -209.34 1502.48 -0.106123
13.03 26.1965 -79.9641 -208.506 1502.6 0.393318
13.04 26.1967 -79.9641 -207.578 1502.84 0.252954
13.05 26.1968 -79.964 -206.99 1502.96 0.369716
13.06 26.1969 -79.964 -206.171 1503.08 -0.141104
13.07 26.1971 -79.964 -205.581 1503.19 0.0037191
13.08 26.1972 -79.964 -204.689 1503.3 0.342467
13.09 26.1973 -79.964 -204.062 1503.41 0.30929
13.1 26.1975 -79.9639 -203.495 1503.5 0.12136
13.11 26.1976 -79.9639 -202.871 1503.61 0.181637
13.12 26.1977 -79.9639 -202.245 1503.72 0.172132
13.13 26.1979 -79.9639 -201.727 1503.84 -0.152311
13.14 26.198 -79.9639 -201.182 1503.95 0.042482
13.15 26.1981 -79.9638 -200.501 1504.04 -0.250624
13.16 26.1983 -79.9638 -200.021 1504.13 0.249254
13.17 26.1984 -79.9638 -199.267 1504.26 -0.0124543
13.18 26.1986 -79.9638 -198.896 1504.29 0.373258
13.19 26.1987 -79.9638 -198.188 1504.41 0.293484
13.2 26.1988 -79.9637 -197.865 1504.43 -0.109521

Although the sounds speeds also seem to be different between these two cases, this is may a side effect of the fact that the paths take a different route when dc/dr changes.

campreilly commented 9 years ago

Created branch called issue#241 to allow us to re-visit this issue later.