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. 关于更改oscillatingDisplacement实现边界运动的问题

关于更改oscillatingDisplacement实现边界运动的问题

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

    在oscillatingDisplacement的基础上更改,希望实现边界运动方式是时间和空间的函数f(x,t);

    void oscillatingDynamicPointPatchVectorField::updateCoeffs()
    {
        if (this->updated())
        {
            return;
        }
    
        const pointPatch& p = this->patch();
        const polyMesh& mesh = this->internalField().mesh()();
        const Time& t = mesh.time();
        
           scalar x = p.x();
        
           Field<vector>::operator=(amplitude_*cos(omega_*t.value()))*sin((x-0.1)*6.28/0.1));
        
        fixedValuePointPatchField<vector>::updateCoeffs();
    }
    

    编译后报错:

    pointPatchFields/derived/oscillatingDynamic/oscillatingDynamicPointPatchVectorField.C: In member function ‘virtual void Foam::oscillatingDynamicPointPatchVectorField::updateCoeffs()’:
    pointPatchFields/derived/oscillatingDynamic/oscillatingDynamicPointPatchVectorField.C:112:21: error: ‘const class Foam::pointPatch’ has no member named ‘x’
            scalar x = p.x();
                         ^
    pointPatchFields/derived/oscillatingDynamic/oscillatingDynamicPointPatchVectorField.C:114:87: error: invalid operands of types ‘void’ and ‘Foam::doubleScalar {aka double}’ to binary ‘operator*’
     ld<vector>::operator=(amplitude_*cos(omega_*t.value()))*sin((x-0.1)*6.28/0.1));
                                                                                 ^
    
    

    主要是不知如何定义调用空间位置;求助各位老师同学们。谢谢

    1 条回复 最后回复
  • E 离线
    E 离线
    ewz
    写于 最后由 编辑
    #2

    编译成功后,试算出现如下问题:

    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::sigFpe::sigHandler(int) at ??:?
    #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
    #3  Foam::smoothSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
    #4  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
    #5  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
    #6  Foam::fvMatrix<double>::solve() at ??:?
    #7  Foam::SolverPerformance<double> Foam::solve<double>(Foam::tmp<Foam::fvMatrix<double> > const&) at ??:?
    #8  Foam::LESModels::kEqn<Foam::IncompressibleTurbulenceModel<Foam::transportModel> >::correct() at ??:?
    #9  ? at ??:?
    #10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
    #11  ? at ??:?
    浮点数例外 (核心已转储)
    

    应该是fvsolution里的设置有问题,但不清楚如何更改,求助

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

    湍流模型发散了,原因不好说呀

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

    E 1 条回复 最后回复
  • E 离线
    E 离线
    ewz
    在 中回复了 李东岳 最后由 编辑
    #4

    @东岳 老师你好
    对边界运动的代码修改后,又出现了以下错误:

    --> FOAM FATAL ERROR: 
    given patch field does not correspond to the meshPoints. Field size: 0 meshPoints size: 4221
    
        From function void Foam::pointPatchField<Type>::setInInternalField(Foam::Field<Type2>&, const Foam::Field<Type2>&, const labelList&) const [with Type1 = Foam::Vector<double>; Type = Foam::Vector<double>; Foam::labelList = Foam::List<int>]
        in file /home/dyfluid/OpenFOAM/OpenFOAM-6/src/OpenFOAM/lnInclude/pointPatchField.C at line 283.
    
    FOAM aborting
    
    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::error::abort() at ??:?
    #2  void Foam::pointPatchField<Foam::Vector<double> >::setInInternalField<Foam::Vector<double> >(Foam::Field<Foam::Vector<double> >&, Foam::Field<Foam::Vector<double> > const&) const at ??:?
    #3  Foam::oscillatingDynamicPointPatchVectorField::updateCoeffs() at ??:?
    #4  Foam::displacementLaplacianFvMotionSolver::solve() at ??:?
    #5  Foam::motionSolver::newPoints() at ??:?
    #6  Foam::dynamicMotionSolverFvMesh::update() at ??:?
    #7  ? at ??:?
    #8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
    #9  ? at ??:?
    已放弃 (核心已转储)
    

    好像是边界位置没有对应的网格点......

    1 条回复 最后回复
  • E 离线
    E 离线
    ewz
    写于 最后由 编辑
    #5

    之前的错误通过以下可以解决:

    scalarField xCoord = patch().localPoints().component(vector::X);
    

    获取边界位置点的坐标;
    这次同样编译成功了,但是一试算,就出现问题了;

    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::sigFpe::sigHandler(int) at ??:?
    #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
    #3  Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:?
    #4  Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:?
    #5  Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
    #6  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
    #7  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
    #8  ? at ??:?
    #9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
    #10  ? at ??:?
    浮点数例外 (核心已转储)
    
    1 条回复 最后回复
  • 李东岳李 离线
    李东岳李 离线
    李东岳 管理员
    写于 最后由 编辑
    #6

    发散了.... :zoule:

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

    1 条回复 最后回复
  • M 离线
    M 离线
    milk22
    写于 最后由 编辑
    #7

    网格质量问题吧,可以先用那个move动网格命令检查一下运动过程的网格质量

    1 条回复 最后回复

  • 登录

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