Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. OpenFOAM
  3. 利用散点插值成连续曲线作为另外一个几何的边界条件?

利用散点插值成连续曲线作为另外一个几何的边界条件?

已定时 已固定 已锁定 已移动 OpenFOAM
6 帖子 2 发布者 5.9k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • J 离线
    J 离线
    jiangqih
    写于 最后由 编辑
    #1

    我现在有个一个压强随x方向变化的散点文件,我现在需要对这个散点进行插值形成曲线作为另外一个几何边界的边界条件,在OF中该怎么实现呢?

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #2

    请参考下面的边界条件:

    inlet
        {
            type            fixedProfile;
            profile         csvFile;
    
            profileCoeffs
            {
                nHeaderLine         1;          // Number of header lines
                refColumn           0;          // Reference column index
                componentColumns    (1);    // Component column indices
                separator           ",";        // Optional (defaults to ",")
                mergeSeparators     no;         // Merge multiple separators
                fileName            "inletProfiles/alpha.csv";
                outOfBounds         clamp;      // Optional out-of-bounds handling
                interpolationScheme linear;     // Optional interpolation scheme
            }
            direction        (1 0 0);
            origin           0;
        }
    

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    1 条回复 最后回复
  • J 离线
    J 离线
    jiangqih
    写于 最后由 编辑
    #3

    boundaryField
    {
    front
    {
    type empty;
    }
    cyc_left
    {
    type cyclic;
    }
    top
    {
    type uniformTotalPressure;
    profile csvFile;
    profileCoeffs
    {
    nHeaderLine 0; // Number of header lines
    refColumn 0; // Reference column index
    componentColumns (1 2); // Component column indices
    separator ","; // Optional (defaults to ",")
    mergeSeparators no; // Merge multiple separators
    fileName "dataFile.csv"; // name of csv data file
    outOfBounds clamp; // Optional out-of-bounds handling
    interpolationScheme linear; // Optional interpolation scheme
    }
    direction (1 0 0);
    origin 0;
    }
    bottom
    {
    type zeroGradient;
    }
    back
    {
    type empty;
    }
    cyc_right
    {
    type cyclic;
    }
    }

    data file 格式
    0,0
    0.005,0.043
    0.01,0.158
    0.015,0.311
    0.02,0.482
    0.025,0.663
    0.03,0.845
    0.035,1.022
    0.04,1.187
    0.045,1.334
    0.05,1.46
    0.055,1.561
    0.06,1.637
    0.065,1.69
    0.07,1.723
    0.075,1.737
    0.08,1.735
    0.085,1.717
    0.09,1.688
    0.095,1.648
    0.1,1.599
    0.105,1.543
    0.11,1.48
    0.115,1.412
    0.12,1.34
    0.125,1.263
    0.13,1.183
    0.135,1.099
    0.14,1.012
    0.145,0.922
    0.15,0.829
    0.155,0.733
    0.16,0.633
    0.165,0.531
    0.17,0.425
    0.175,0.315
    0.18,0.201
    0.185,0.083
    0.19,-0.041
    0.195,-0.172
    0.2,-0.31
    0.205,-0.457
    0.21,-0.615
    0.215,-0.789
    0.22,-0.982
    0.225,-1.21
    0.23,-1.469
    0.235,-1.853
    0.24,-2.185
    0.245,-2.948
    0.25,-2.923
    0.255,-2.011
    0.26,-1.717
    0.265,-1.562
    0.27,-1.437
    0.275,-1.32
    0.28,-1.209
    0.285,-1.101
    0.29,-0.996
    0.295,-0.894
    0.3,-0.797
    0.305,-0.702
    0.31,-0.61
    0.315,-0.521
    0.32,-0.437
    0.325,-0.358
    0.33,-0.285
    0.335,-0.22
    0.34,-0.152
    0.345,-0.065
    0.35,-0.017

    但是一直报错,找了好久也没找出原因来

    --> FOAM FATAL IO ERROR:
    keyword file is undefined in dictionary "/home/qihao/OpenFOAM/qihao-5.0/run/hyporheic/Hyporheic/Groundwater/Stratified/0/p.boundaryField.top.profileCoeffs"

    file: /home/qihao/OpenFOAM/qihao-5.0/run/hyporheic/Hyporheic/Groundwater/Stratified/0/p.boundaryField.top.profileCoeffs from line 38 to line 45.

    From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 566.
    
    1 条回复 最后回复
  • J 离线
    J 离线
    jiangqih
    写于 最后由 编辑
    #4

    p文件用的是这个,上面回复错了
    boundaryField
    {
    front
    {
    type empty;
    }
    cyc_left
    {
    type cyclic;
    }
    top
    {
    type fixedProfile;;
    profile csvFile;
    profileCoeffs
    {
    nHeaderLine 0; // Number of header lines
    refColumn 0; // Reference column index
    componentColumns (1 2); // Component column indices
    separator ","; // Optional (defaults to ",")
    mergeSeparators no; // Merge multiple separators
    fileName "dataFile.csv"; // name of csv data file
    outOfBounds clamp; // Optional out-of-bounds handling
    interpolationScheme linear; // Optional interpolation scheme
    }
    direction (1 0 0);
    origin 0;
    }
    bottom
    {
    type zeroGradient;
    }
    back
    {
    type empty;
    }
    cyc_right
    {
    type cyclic;
    }
    }

    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #5

    把这个

    fileName “dataFile.csv”; // name of csv data file
    

    改为

    file  “dataFile.csv”; // name of csv data file
    

    估计你用的OpenFOAM-5.x

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    J 1 条回复 最后回复
  • J 离线
    J 离线
    jiangqih
    在 中回复了 李东岳 最后由 编辑
    #6

    @李东岳 谢谢东岳老师,明天再试一下

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]