• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

水污染扩散-一维二维模型在线展示

武飞扬头像
之乎Z也
帮助0

1 在线模拟示例

在线模拟示例

学新通

学新通

2 水污染扩散过程

地表水(surface water),是指陆地表面上动态水和静态水的总称,亦称“陆地水”,包括各种液态的和固态的水体,主要有河流、湖泊、沼泽、冰川、冰盖等。它是人类生活用水的重要来源之一,也是各国水资源的主要组成部分。

1.物理过程:物理过程主要是指污染物在水体中的混合稀释和自然沉淀过程。只改变进入水体污染物的物理性状、空间位置,而不改变其化学性质、不参与生物作用。
水体的混合稀释作用主要由下面三部分作用所致:紊动扩散、移流、离散。
(1)紊动扩散:由水流的紊动特性引起水中污染物自高浓度向低浓度区转移的扩散。
(2)移流:由于水流的推动使污染物的迁移随水流输移。
(3)离散:由于水流方向横断面上流速分布的不均匀(由河岸及河底阻力所致)而引起分散。
2.化学过程:污染物在水体中发生化学性质或形态、价态上的转化,使水质发生化学性质的变化。
主要包括酸碱中和、氧化-还原、分解-化合、吸附-解吸、胶溶-凝聚等过程
3.生物自净过程:是水体中的污染物经生物吸收、降解作用而发生消失或浓度降低的过程。
影响生物自净作用的关键是:溶解氧的含量,有机污染物的性质、浓度以及微生物的种类、数量等。

 3 一维模型


一维河流水质模型是目前应用最广泛的模型,它适用于污染物浓度仅在一个方向上有变化的场合,如宽度比较窄的河流。如果河段横截面、流速、流量、污染物的排入量和弥散系数不随时间变化,且污染物的衰减符合一级反应,河段不考虑源和汇。

学新通

4 二维模型

二维河流水质模型在如下条件下使用:
(1)平直、断面形状规则河段混合过程段;
(2)持久性污染物;    
(3)河流为恒定流动;
(4)连续稳定排放; 

学新通

5 部分代码

  1.  
    package com.planet.engine.water.param;
  2.  
     
  3.  
    import lombok.Data;
  4.  
     
  5.  
    /**
  6.  
    * 非持久性污染物 - 一维模型参数
  7.  
    */
  8.  
    @Data
  9.  
    public class BusD1Param {
  10.  
    /**
  11.  
    * ex—— 纵向扩散系数,m2/s
  12.  
    */
  13.  
    private double ex = 0.045;
  14.  
     
  15.  
    /**
  16.  
    * C0—— 完全混合计算所得初始浓度(s-p模式下是BOD浓度),mg/L;
  17.  
    */
  18.  
    private double c0 = 10d;
  19.  
     
  20.  
    /**
  21.  
    * K —— 污染物的衰减系数,1/d;
  22.  
    */
  23.  
    private double k = 0.045d;
  24.  
     
  25.  
    /**
  26.  
    * K —— 污染物的衰减系数,1/d;
  27.  
    */
  28.  
    private double k1 = 0.194d;
  29.  
     
  30.  
    /**
  31.  
    * B —— 河宽,m;
  32.  
    */
  33.  
    private double bupper = 100d;
  34.  
     
  35.  
    /**
  36.  
    * A —— 河流截面积,m2;
  37.  
    */
  38.  
    private double aupper = 300d;
  39.  
     
  40.  
    }
学新通
  1.  
    @RestController
  2.  
    @RequestMapping("/api/water/1d")
  3.  
    @Api(value = "WaterD1SimuApi", description = "水污染扩散模拟-一维模型")
  4.  
    public class WaterD1SimuApi extends MyBaseApi {
  5.  
    @Autowired
  6.  
    private WaterDiffService waterDiffService;
  7.  
     
  8.  
    @Autowired
  9.  
    private SimuHistService simuHistService;
  10.  
     
  11.  
     
  12.  
    /**
  13.  
    * 非持久性污染物(nonconservative pollutant)
  14.  
    * 指在地表水中由于生物作用而逐渐减少的污染物,例如耗氧有机物,BOD/COD>0.3,
  15.  
    * 则判别其为非持久性污染物;
  16.  
    * <p>
  17.  
    * 一维河流水质模型是目前应用最广泛的模型,它适用于污染物浓
  18.  
    * 度仅在一个方向上有变化的场合,如宽度比较窄的河流。
  19.  
    * 如果河段横截面、流速、流量、污染物的排入量和弥散系数不随时
  20.  
    * 间变化,且污染物的衰减符合一级反应,河段不考虑源和汇。
  21.  
    *
  22.  
    * @param params
  23.  
    * @return
  24.  
    */
  25.  
    @LimitRequest
  26.  
    @ResponseBody
  27.  
    @RequestMapping(value = "/mixing-length", method = RequestMethod.POST)
  28.  
    @ApiOperation(value = "一维-混合过程段长度")
  29.  
    public Result d1SimuMixLength(@RequestBody WaterD1MixParam params) {
  30.  
    if (params.getProcParams().getGridLen() != 0
  31.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  32.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和步长距离!");
  33.  
    }
  34.  
    D1MixWrapData result = this.waterDiffService.mixLength(params);
  35.  
     
  36.  
    // 异步保存历史纪录
  37.  
    SecurityUser securityUser = this.getLoginUser();
  38.  
    String paramsStr = this.getReqParams(params);
  39.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D_MIXING_LENGTH, paramsStr, StatusType.SUCCESS.code(), result);
  40.  
     
  41.  
    return this.getResult(ResultCode.SUCCESS, result);
  42.  
    }
  43.  
     
  44.  
     
  45.  
    /**
  46.  
    * 非持久性污染物(nonconservative pollutant)
  47.  
    * 指在地表水中由于生物作用而逐渐减少的污染物,例如耗氧有机物,BOD/COD>0.3,
  48.  
    * 则判别其为非持久性污染物;
  49.  
    * <p>
  50.  
    * 一维河流水质模型是目前应用最广泛的模型,它适用于污染物浓
  51.  
    * 度仅在一个方向上有变化的场合,如宽度比较窄的河流。
  52.  
    * 如果河段横截面、流速、流量、污染物的排入量和弥散系数不随时
  53.  
    * 间变化,且污染物的衰减符合一级反应,河段不考虑源和汇。
  54.  
    *
  55.  
    * @param params
  56.  
    * @return
  57.  
    */
  58.  
    @LimitRequest
  59.  
    @ResponseBody
  60.  
    @RequestMapping(value = "/", method = RequestMethod.POST)
  61.  
    @ApiOperation(value = "一维模式-通用水质模拟模型")
  62.  
    public Result d1Simu(@RequestBody WaterD1Param params) {
  63.  
    if (params.getProcParams().getGridLen() != 0
  64.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  65.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和格网距离!");
  66.  
    }
  67.  
    String result = this.waterDiffService.d1Diff(params);
  68.  
     
  69.  
    // 异步保存历史纪录
  70.  
    SecurityUser securityUser = this.getLoginUser();
  71.  
    String paramsStr = this.getReqParams(params);
  72.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D, paramsStr, StatusType.SUCCESS.code(), result);
  73.  
     
  74.  
    return this.getResult(ResultCode.SUCCESS, result);
  75.  
    }
  76.  
     
  77.  
     
  78.  
    /**
  79.  
    * 非持久性污染物持续排放(nonconservative pollutant)
  80.  
    * 指在地表水中由于生物作用而逐渐减少的污染物,例如耗氧有机物,BOD/COD>0.3,
  81.  
    * 则判别其为非持久性污染物;
  82.  
    * <p>
  83.  
    * 一维河流水质模型是目前应用最广泛的模型,它适用于污染物浓
  84.  
    * 度仅在一个方向上有变化的场合,如宽度比较窄的河流。
  85.  
    * 如果河段横截面、流速、流量、污染物的排入量和弥散系数不随时
  86.  
    * 间变化,且污染物的衰减符合一级反应,河段不考虑源和汇。
  87.  
    *
  88.  
    * @param params
  89.  
    * @return
  90.  
    */
  91.  
    @LimitRequest
  92.  
    @ResponseBody
  93.  
    @RequestMapping(value = "/std/continue", method = RequestMethod.POST)
  94.  
    @ApiOperation(value = "一维模式-水质模拟模型(持续排放)")
  95.  
    public Result d1SimuStd(@RequestBody WaterD1Param params) {
  96.  
    if (params.getProcParams().getGridLen() != 0
  97.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  98.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和格网距离!");
  99.  
    }
  100.  
    String result = this.waterDiffService.d1DiffStd(params);
  101.  
     
  102.  
    // 异步保存历史纪录
  103.  
    SecurityUser securityUser = this.getLoginUser();
  104.  
    String paramsStr = this.getReqParams(params);
  105.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D_CONTINUE, paramsStr, StatusType.SUCCESS.code(), result);
  106.  
     
  107.  
    return this.getResult(ResultCode.SUCCESS, result);
  108.  
    }
  109.  
     
  110.  
    /**
  111.  
    * 非持久性污染物瞬时排放(nonconservative pollutant)
  112.  
    * 指在地表水中由于生物作用而逐渐减少的污染物,例如耗氧有机物,BOD/COD>0.3,
  113.  
    * 则判别其为非持久性污染物;
  114.  
    * <p>
  115.  
    * 一维河流水质模型是目前应用最广泛的模型,它适用于污染物浓
  116.  
    * 度仅在一个方向上有变化的场合,如宽度比较窄的河流。
  117.  
    * 如果河段横截面、流速、流量、污染物的排入量和弥散系数不随时
  118.  
    * 间变化,且污染物的衰减符合一级反应,河段不考虑源和汇。
  119.  
    *
  120.  
    * @param params
  121.  
    * @return
  122.  
    */
  123.  
    @LimitRequest
  124.  
    @ResponseBody
  125.  
    @RequestMapping(value = "/std/instant", method = RequestMethod.POST)
  126.  
    @ApiOperation(value = "一维模式-水质模拟模型(瞬时排放)")
  127.  
    public Result d1SimuInstantStd(@RequestBody WaterD1InstParam params) {
  128.  
    if (params.getProcParams().getGridLen() != 0
  129.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  130.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和格网距离!");
  131.  
    }
  132.  
    D1InstWrapData result = this.waterDiffService.d1SimuInstantStd(params);
  133.  
     
  134.  
    // 异步保存历史纪录
  135.  
    SecurityUser securityUser = this.getLoginUser();
  136.  
    String paramsStr = this.getReqParams(params);
  137.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D_INSTANT,
  138.  
    paramsStr, StatusType.SUCCESS.code(), result);
  139.  
     
  140.  
    return this.getResult(ResultCode.SUCCESS, result);
  141.  
    }
  142.  
     
  143.  
     
  144.  
    /**
  145.  
    * 非持久性污染物(nonconservative pollutant)
  146.  
    * BOD浓度计算
  147.  
    * <p>
  148.  
    * Streeter-Phelps,简称S-P模式:
  149.  
    * ⑴假设河流中的BOD的衰减和溶解氧的复氧来源都是一级反应;
  150.  
    * ⑵反应速度是恒定的;
  151.  
    * ⑶河流中的耗氧是由BOD衰减引起的;
  152.  
    * ⑷而河流中的溶解氧来源则是大气复氧)。
  153.  
    *
  154.  
    * @param params
  155.  
    * @return
  156.  
    */
  157.  
    @LimitRequest
  158.  
    @ResponseBody
  159.  
    @RequestMapping(value = "/s-p/bod", method = RequestMethod.POST)
  160.  
    @ApiOperation(value = "一维模式-S-P水质模拟模型(BOD浓度)")
  161.  
    public Result d1SpBodSimu(@RequestBody WaterD1SpParam params) {
  162.  
    if (params.getProcParams().getGridLen() != 0
  163.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  164.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和步长距离!");
  165.  
    }
  166.  
    String result = this.waterDiffService.spBodDiff(params);
  167.  
     
  168.  
    // 异步保存历史纪录
  169.  
    SecurityUser securityUser = this.getLoginUser();
  170.  
    String paramsStr = this.getReqParams(params);
  171.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D_SP, paramsStr,
  172.  
    StatusType.SUCCESS.code(), result);
  173.  
     
  174.  
    return this.getResult(ResultCode.SUCCESS, result);
  175.  
    }
  176.  
     
  177.  
     
  178.  
    /**
  179.  
    * 非持久性污染物(nonconservative pollutant)
  180.  
    * 亏氧量计算
  181.  
    * <p>
  182.  
    * Streeter-Phelps,简称S-P模式:
  183.  
    * ⑴假设河流中的BOD的衰减和溶解氧的复氧来源都是一级反应;
  184.  
    * ⑵反应速度是恒定的;
  185.  
    * ⑶河流中的耗氧是由BOD衰减引起的;
  186.  
    * ⑷而河流中的溶解氧来源则是大气复氧)。
  187.  
    *
  188.  
    * @param params
  189.  
    * @return
  190.  
    */
  191.  
    @LimitRequest
  192.  
    @ResponseBody
  193.  
    @RequestMapping(value = "/s-p/odis", method = RequestMethod.POST)
  194.  
    @ApiOperation(value = "一维模式-S-P水质模拟模型(溶氧量)")
  195.  
    public Result d1SpOdDisSimu(@RequestBody WaterD1SpOdParam params) {
  196.  
    if (params.getProcParams().getGridLen() != 0
  197.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  198.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和格网距离!");
  199.  
    }
  200.  
    D1SpWrapData result = this.waterDiffService.spOdDisDiff(params);
  201.  
     
  202.  
    // 异步保存历史纪录
  203.  
    SecurityUser securityUser = this.getLoginUser();
  204.  
    String paramsStr = this.getReqParams(params);
  205.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D_SP_ODIS, paramsStr,
  206.  
    StatusType.SUCCESS.code(), result);
  207.  
     
  208.  
    return this.getResult(ResultCode.SUCCESS, result);
  209.  
    }
  210.  
     
  211.  
     
  212.  
    /**
  213.  
    * 非持久性污染物(nonconservative pollutant)
  214.  
    * 亏氧量计算
  215.  
    * <p>
  216.  
    * Streeter-Phelps,简称S-P模式:
  217.  
    * ⑴假设河流中的BOD的衰减和溶解氧的复氧来源都是一级反应;
  218.  
    * ⑵反应速度是恒定的;
  219.  
    * ⑶河流中的耗氧是由BOD衰减引起的;
  220.  
    * ⑷而河流中的溶解氧来源则是大气复氧)。
  221.  
    *
  222.  
    * @param params
  223.  
    * @return
  224.  
    */
  225.  
    @LimitRequest
  226.  
    @ResponseBody
  227.  
    @RequestMapping(value = "/s-p/odif", method = RequestMethod.POST)
  228.  
    @ApiOperation(value = "一维模式-S-P水质模拟模型(亏氧量)")
  229.  
    public Result d1SpOdDifSimu(@RequestBody WaterD1SpOdParam params) {
  230.  
    if (params.getProcParams().getGridLen() != 0
  231.  
    & params.getProcParams().getSimuLength() / params.getProcParams().getGridLen() > 1000) {
  232.  
    throw new DataOptionException("云主机资源有限,请缩短模拟时间和格网距离!");
  233.  
    }
  234.  
    D1SpWrapData result = this.waterDiffService.spOdDifDiff(params);
  235.  
     
  236.  
    // 异步保存历史纪录
  237.  
    SecurityUser securityUser = this.getLoginUser();
  238.  
    String paramsStr = this.getReqParams(params);
  239.  
    this.simuHistService.save(securityUser, SimuType.WATER_1D_SP_ODIF, paramsStr,
  240.  
    StatusType.SUCCESS.code(), result);
  241.  
     
  242.  
    return this.getResult(ResultCode.SUCCESS, result);
  243.  
    }
  244.  
     
  245.  
    }
学新通
  1.  
    public static void main0(String[] args) {
  2.  
    File file = new File("D:\\\\fenghe-desolve\\river-line.shp");
  3.  
    SimpleFeatureCollection featureCollection = null;
  4.  
    try {
  5.  
    // 读取源文件shape
  6.  
    ShapefileDataStore dataStore = new ShapefileDataStore(file.toURI().toURL());
  7.  
    dataStore.setCharset(StandardCharsets.UTF_8);
  8.  
    System.out.println(dataStore.getCharset() "获取编码11111111111111111");
  9.  
    SimpleFeatureSource featureSource = dataStore.getFeatureSource();
  10.  
    featureCollection = featureSource.getFeatures();
  11.  
    // 读取线状河流
  12.  
    SimpleFeatureIterator iterator1 = (SimpleFeatureIterator) featureCollection.features();
  13.  
    SimpleFeature simpleFeature = iterator1.next();
  14.  
    MultiLineString geom = (MultiLineString) simpleFeature.getDefaultGeometry();
  15.  
    LineString river = (LineString) geom.getGeometryN(0);
  16.  
    Coordinate endPt = river.getCoordinates()[river.getCoordinates().length - 1];
  17.  
    iterator1.close();
  18.  
     
  19.  
     
  20.  
    ShapefileDataStore ds = new ShapefileDataStore(s1.toURI().toURL());
  21.  
    // ds.setCharset(StandardCharsets.UTF_8);
  22.  
    ds.setCharset(Charset.forName("GBK"));
  23.  
    System.out.println(ds.getCharset() "获取编码22222222");
  24.  
     
  25.  
    SimpleFeatureType sft = fs.getSchema();
  26.  
    //创建
  27.  
    ds.createSchema(sft);
  28.  
     
  29.  
    //设置Writer,并设置为自动提交
  30.  
    FeatureWriter<SimpleFeatureType, SimpleFeature> writer = ds.getFeatureWriter(ds.getTypeNames()[0], Transaction.AUTO_COMMIT);
  31.  
     
  32.  
    //循环写入要素
  33.  
    while (iterator.hasNext()) {
  34.  
    //获取要写入的要素
  35.  
    SimpleFeature feature = iterator.next();
  36.  
    //将要写入位置
  37.  
    SimpleFeature featureBuf = writer.next();
  38.  
    //设置写入要素所有属性
  39.  
    featureBuf.setAttributes(feature.getAttributes());
  40.  
    //获取the_geom属性的值
  41.  
    Geometry geo = (Geometry) feature.getAttribute("the_geom");
  42.  
    // //重新覆盖the_geom属性的值,这里的geoBuffer必须为Geometry类型
  43.  
    featureBuf.setAttribute("the_geom", geo);
  44.  
    }
  45.  
    //将所有数据写入
  46.  
    writer.write();
  47.  
    //关闭写入流
  48.  
    writer.close();
  49.  
    iterator.close();
  50.  
    } catch (Exception e) {
  51.  
    e.printStackTrace();
  52.  
    }
  53.  
     
  54.  
     
  55.  
    }
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /news/detail/tanhcckkij
系列文章
更多 icon
同类精品
更多 icon
继续加载