geometry.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:fluids 作者: CalebBell 项目源码 文件源码
def set_table(self, n=100, dx=None):
        r'''Method to set an interpolation table of liquids levels versus
        volumes in the tank, for a fully defined tank. Normally run by the
        h_from_V method, this may be run prior to its use with a custom
        specification. Either the number of points on the table, or the
        vertical distance between steps may be specified.

        Parameters
        ----------
        n : float, optional
            Number of points in the interpolation table, [-]
        dx : float, optional
            Vertical distance between steps in the interpolation table, [m]
        '''
        if dx:
            self.heights = np.linspace(0, self.h_max, int(self.h_max/dx)+1)
        else:
            self.heights = np.linspace(0, self.h_max, n)
        self.volumes = [self.V_from_h(h) for h in self.heights]
        self.interp_h_from_V = InterpolatedUnivariateSpline(self.volumes, self.heights, ext=3)
        self.table = True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号