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
1 帖子 1 发布者 716 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • T 离线
    T 离线
    TM
    写于 最后由 李东岳 编辑
    #1

    在lagrangian/intermediate/submodels/Kinematic/ParticleForces路径下添加了一个电场力模型,编译通过,case计算时报错,似乎跟q和E变量未初始化有关,代码小白,求指点。

    563ac197-796b-4021-a867-d6ecd3a34007-image.png
    648c605a-93af-4ff6-9178-8242e48f84bd-image.png

    
    // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
    template<class CloudType>
    Foam::ElectricfieldForce<CloudType>::ElectricfieldForce
    (
        CloudType& owner,
        const fvMesh& mesh,
        const dictionary& dict,
        const word& forceType,
        const volScalarField& qField
    )
    
    : 
        ParticleForce<CloudType>(owner, mesh, dict, forceType, true),
        EName_(this->coeffs().template lookupOrDefault<word>("E", "E")),
        EInterpPtr_(NULL),
        qField_(qField)
    {
        Info<< "-----p in ELe\n" << endl;
        qInterpPtr_.reset
        (
            interpolation<scalar>::New
            (
                owner.solution().interpolationSchemes(),
                qField
            ).ptr()
        );
        Info<< "-----p2 in ELe\n" << endl;
    }
    
    template<class CloudType>
    Foam::ElectricfieldForce<CloudType>::ElectricfieldForce
    (
        const ElectricfieldForce& etf
    )
    :
        ParticleForce<CloudType>(etf),
        EName_(etf.EName_),
        EInterpPtr_(NULL),
        qField_(etf.qField_)
    {}
    
    1 条回复 最后回复

  • 登录

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