Coder Social home page Coder Social logo

Comments (5)

philippkraft avatar philippkraft commented on June 12, 2024

While the reach geometry has of course some influence on the transport equation, I would deem the parameter uncertainty of the Manning n as the greater problem. From that perspective I would use for the picture on top SWATReachType (which is a trapezoid crosssection + bank overflow mechanism), the 2nd a TriangularReach, assuming bank overflow never happens (else use SWATReachType again) and the 3rd a RectangularReach.

However, I have thought a long time ago about a generic reach type using a vector of coordinates for the functions P(d) and A(d). The ideas are conserved in the end of ReachType.h:488-503. But I stopped there, because this was not important for me.

I do not think that we gain anything by yet another special reach type - lets rather go for a generalized formulation. I do not have the time to do the math, but I can translate a Python prototype into cmf's C++ code.

from cmf.

philippkraft avatar philippkraft commented on June 12, 2024

If someone provides the Python prototype, please use the following (Python 3.5+) template:

class CrossSectionReach:
    
    def __init__(self, n_manning: float, x: Sequence[float], depth: Sequence[float]):
        self.x = x
        self.depth = depth
        self.n_manning = n_manning
        
    def set_nManning(self, val: float) -> None:
        self.nManning = val
    
    def get_nManning(self) -> float:
        return self.nManning
    
    def typecode(self) -> str:
        return 'C'
    
    def get_channel_width(self, depth: float) -> float:
        """
        Calculates the flow width from a given actual depth [m] using the actual geometry
        :param depth: Actual depth in m
        :return: Actual channel width in m 
        """
        ...

    def get_wetted_perimeter(self, depth: float) -> float:
        """
        Calculates the wetted perimeter from a given actual depth [m] using the actual geometry
        :return: 
        """
        ...
    
    def get_depth(self, area: float) -> float:
        """
        Calculates the actual depth of the reach from the wetted area using the geometry
        :param area: The actual wetted area in m², can be obtained by V/l, 
                     where V is the stored volume and l is the reach length
        :return: the actual depth in m
        """
        ...        
    
    def get_flux_cross_section(self, depth: float) -> float:
        """
        Calculates the wetted area from a given depth using the IChannel geometry.
        :param depth: depth of the reach m
        :return: Wetted area of a river cross section in m²
        """
        ...

from cmf.

smultsch avatar smultsch commented on June 12, 2024

Ok, thanks. A generic reach type would be very interesting, but is not necessary for my current work. So, in order to have trapezoid cross-section I can just use the SWATReachType and disable the flood plain (e.g. by setting FloodPlainSlope=90%)?

from cmf.

philippkraft avatar philippkraft commented on June 12, 2024

Just make a huuuuge channel depth, eg. 20m

from cmf.

smultsch avatar smultsch commented on June 12, 2024

Thanks, this solution seems to be working. But it is a little bit tricky to figure out what parameters of the SWATReachType must be set by the user and which one are calculated by CMF. For example, in case of a trapezial shape the user must initialize the reach with "FlowWidht,BankWidth,ChannelDepth" and additionally set the BottomWidth by accessing the related property. Maybe this could be clarified in future.

reachshape = cmf.SWATReachType(FlowWidht,BankWidth,ChannelDepth)
reachshape.BottomWidth = 0.3

test_reachshapes.zip

from cmf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.