⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yfeng.cls

📁 利用差分方法求解二阶微分方程!流体力学应用!
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Yfeng"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public X_1 As Single '左边界条件
Public X_2 As Single '右边界条件
Public T_0 As Variant '初始值
Public Y_0 As Variant
Public X_0 As Variant
Public mesh_t As Integer '时间点划分
Public mesh_x As Integer '空间点划分
Public C As Single    '传播速度
Public dt As Single   '时间步长
Public dx As Single   '空间步长
Public time_length As Single '计算时间长度
Public Space_length_x As Single '计算空间x步长
Public CFD_Values As Variant  '计算值
Public Function iterate_C_pluse(ByVal Uij As Double, ByVal Uij_1 As Double) As Double  '传播速度>0时的迭代格式
    Dim coefficient As Single
    coefficient = C * dt / dx
    iterate_C_pluse = Uij - coefficient * (Uij - Uij_1)
End Function

Public Function iterate_C_minus(Uij As Double, Uijp1 As Double) As Double '传播速度<0时的迭代格式
    Dim coefficient As Single
    coefficient = C * dt / dx
    iterate_C_minus = Uij - coefficient * (Uijp1 - Uij)
End Function

Public Sub Mesh()
'ReDim
    Dim step_t As Integer
    Dim step_x As Integer
    step_t = 1 + time_length / dt
    step_x = 1 + Space_length_x / dx
    mesh_t = step_t
    mesh_x = step_x
    ReDim CFD_Values(0 To step_t, 0 To step_x)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -