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中文网

liujmL

LiuJiaming

@liujm
关于
帖子
48
主题
6
群组
0
粉丝
0
关注
4

帖子

最新

  • OpenFOAM v2012 waves2foam 造波问题
    liujmL liujm

    @bike-北辰 在 OpenFOAM v2012 waves2foam 造波问题 中说:

    @liujm 您好,waves2foam 的版本应该是2148,编译前手动下载了OceanWave3D-Fortran90,然后修改了一下./Allwmake文件,具体可以参考(https://blog.csdn.net/Killig_1/article/details/135386466) ,然后正常编译即可。

    嗯嗯,以前编译成功过,可是最近重新编译报错严重,确实主要问题出现在OceanWave3D-Fortran90这里,需要注释掉make中git clone和检查更新部分,感谢~


  • OpenFOAM v2012 waves2foam 造波问题
    liujmL liujm

    bike老师 是否方便提供一下与of2012搭配的waves2foam的安装包下载链接和编译脚本呢


  • 自由来流下的网框表面流速异常
    liujmL liujm

    @xpqiu

    十分感谢老师的指点!

    我检查了所有异常算例,发现问题的确都与0文件中的初始设置有关。

    • 在这个算例里,命令subsetMesh -overwrite frameCellSet -patch frame会将frameCellSet网格区域与frame链接,但是由于没有显式划分frame,因此,subsetMesh会默认生成一个empty类型的边界。

    • 六楼的分析存在大问题,没有参考的必要了。

    再次感谢两位老师的指点:146: ~


  • 自由来流下的网框表面流速异常
    liujmL liujm

    有了一些眉目,排除了网格密度不够的因素,确定与网格加密方式有关。

    图1是以前的网格加密方式,这样会导致网框附近速度异常;改为图2的加密方式,便会达到预期,即网框附近速度也约为预设速度。

    而图2只是在图1的基础上,将z方向所有的加密网格都延伸至计算域边界,只要有一级网格不触及边界(如图3的加密方式),都会计算异常。

    目前,还不清楚具体原因。 在这里记录一下,希望看到的大佬能够帮忙解答~

    图1-1 来流方向视图
    c1a90e71-f4c3-43f9-93c0-7583ea0904b3-image.png

    图1-2 侧视图
    694cd6a6-9095-4b14-b2e1-ba3de5fb66ca-image.png

    图2-1 来流方向视图
    e8824dce-fca5-487c-b883-077dc461fb8a-image.png

    图2-2 侧视图
    dfacc179-27b6-4c20-b504-b58a2482640c-image.png

    图3 来流方向视图
    e5f2408a-cbe5-4ac8-931b-0c8c7588d5bc-image.png


  • 自由来流下的网框表面流速异常
    liujmL liujm

    @李东岳 静态网格也是有这个问题的。按理说不应该啊...我再跑跑其他类似的原生算例

    p:

    #include "../varsSettings" //Include global variables
    
    dimensions	[0 2 -2 0 0 0 0];
    
    internalField	uniform	0;
    
    boundaryField
    {
        inlet
        {
            type            zeroGradient;
        }
    
        outlet
        {
            type            fixedValue;
            value           $internalField;
        }
    
        frontAndBack
        {
            type            empty;//zeroGradient;
        }
    
        topAndBottom
        {
            type            zeroGradient;
        }
        
        frame
        {
            type            zeroGradient;//fixedFluxPressure;
        }
    }
    

    U:

    #include "../varsSettings" //Include global variables
    
    dimensions	[0 1 -1 0 0 0 0];
    
    internalField	uniform	$flowVelocity;
    
    boundaryField
    {
        inlet
        {
            type		fixedValue;
            value		$internalField;
        }
    
        outlet
        {
            type		inletOutlet;
            inletValue	uniform (0 0 0);
            value		$internalField;
        }
    
        frontAndBack
        {
            type		empty;//slip;
            //value		uniform (0 0 0);	
        }
    
        topAndBottom
        {
            type		slip;
            value		uniform (0 0 0);
        }
        
        frame
        {
            type            noSlip;//movingWallVelocity;
            //value           uniform (0 0 0);
        }
    }
    

    算例文件 OpenfOAM2012 网格数4w
    functionalTest_NoPZRefine2_2D_staticMesh.zip


  • 免费帮助debug算例
    liujmL liujm

    @李东岳 李老师好,这里我请教一个问题->链接

    为了简化算例,我把网格三维转化为二维,简化了结构形式,以便排错。

    【算例云图】
    6101495a-adbe-455d-ab41-45e2b1b7b415-image.png
    bb59f1c1-9dde-4169-83d9-cf00c0daf433-image.png

    【简化版算例下载】
    functionalTest_NoPZRefine2_2D.zip
    生成网格createMesh,
    跑算例runCaseOnly,
    全流程runCase

    感谢~


  • 自由来流下的网框表面流速异常
    liujmL liujm

    @李东岳 是的老师,这里我为了排错,先把动网格用constraints六自由度都固定住。
    以下附图:
    bf862295-9608-439b-80a8-4468e486b935-image.png
    be39339e-5c0c-4e14-b928-c616471d493c-image.png


  • 自由来流下的网框表面流速异常
    liujmL liujm

    各位老师好,

    【问题描述】
    本人在使用pimpleFoam模拟固定式网框在自由来流(u=0.5m/s)中的响应。整个流场的计算结果符合预期,可是网框表面处的流速竟然高达1e2量级,明显与现实不符,结果云图如下:(侧视图)
    e59d1920-1831-4e46-922a-23aad7444b8a-image.png
    c0594fbf-9bfc-4ccc-a9b7-beda4decba10-image.png

    【分析】
    网框截面原本比本帖中展示的要更小,起初正方形边长仅分布四个网格,为了排除网格数量对结果的影响,特意扩大了截面,增加边长网格数量。但是现在依然存在这个问题。

    【初始条件设置】
    以下摘抄0文件夹设置:
    p:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  v2012                                 |
    |   \\  /    A nd           | Website:  www.openfoam.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
    	version     2.0;
    	format      ascii;
    	class       volScalarField;
    	location    "0";
    	object      p;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #include "../varsSettings" //Include global variables
    
    dimensions	[0 2 -2 0 0 0 0];
    
    internalField	uniform	0;
    
    boundaryField
    {
        inlet
        {
            type            zeroGradient;
        }
    
        outlet
        {
            type            fixedValue;
            value           $internalField;
        }
    
        frontAndBack
        {
            type            zeroGradient;
        }
    
        topAndBottom
        {
            type            zeroGradient;
        }
        
        frame
        {
            type            fixedFluxPressure;
        }
    }
    
    
    // ************************************************************************* //
    

    U:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  v2012                                 |
    |   \\  /    A nd           | Website:  www.openfoam.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       volVectorField;
        location    "0";
        object      U;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #include "../varsSettings" //Include global variables
    
    dimensions	[0 1 -1 0 0 0 0];
    
    internalField	uniform	$flowVelocity;
    
    boundaryField
    {
        inlet
        {
            type		fixedValue;
            value		$internalField;
        }
    
        outlet
        {
            type		inletOutlet;
            inletValue	uniform (0 0 0);
            value		$internalField;
        }
    
        frontAndBack
        {
            type		slip;
            value		uniform (0 0 0);	
        }
    
        topAndBottom
        {
            type		slip;
            value		uniform (0 0 0);
        }
        
        frame
        {
    /*        type            noSlip; */
            type            movingWallVelocity;
            value           uniform (0 0 0);
        }
    }
    
    
    // ************************************************************************* //
    

    pointDisplacement:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  5                                     |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       pointVectorField;
        object      pointDisplacement;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    dimensions      [0 1 0 0 0 0 0];
    
    internalField   uniform (0 0 0);
    
    boundaryField
    {
    	inlet
    	{
    		type            fixedValue;
    		value           uniform (0 0 0);
    	}
    
    	outlet
    	{
    		type            fixedValue;
    		value           uniform (0 0 0);
    	}
    	
    	frontAndBack
    	{
    		type            fixedValue;
    		value           uniform (0 0 0);
    	}
    	
    	topAndBottom
    	{
    		type            fixedValue;
    		value           uniform (0 0 0);
    	}
    
    	frame
    	{
    		type            calculated;
    		value           uniform (0 0 0);
    	}
    }
    
    // ************************************************************************* //
    

    【算例设置】
    functionalTest_NoPZRefine1.zip
    生成网格createMesh,
    跑算例runCaseOnly,
    全流程runCase

    希望各位老师能给出建议~@李东岳


  • openFoam动网格求助,displacementLaplacian适用性问题!
    liujmL liujm

    @liujm
    问题已解决,添加libs("libfvMotionSolvers.so"),或者参考这里


  • openFoam动网格求助,displacementLaplacian适用性问题!
    liujmL liujm

    @Joker
    您好,请问您使用的OF是什么版本呢?我在用displacementLaplacian后,使用moveDynamicMesh预览网格运动的时候,系统报错,似乎没有displacementLaplacian这个求解器。请问是我的字典设置有误吗?

    Create time
    
    Create mesh for time = 0
    
    Selecting dynamicFvMesh dynamicMotionSolverFvMesh
    Selecting motion solver: displacementLaplacian
    
    
    --> FOAM FATAL IO ERROR: (openfoam-2012)
    Unknown solver type displacementLaplacian
    
    Valid solver types :
    7(coded displacementInterpolation displacementLayeredMotion multiSolidBodyMotionSolver sixDoFRigidBodyMotion solidBody velocityDisplacement)
    
    
    file: /OpenFOAM-v2012/myProject/tutorials/floatingPorousPimpleFoam/Condition1_Uin=1.2/constant/dynamicMeshDict at line 18 to 26.
    
        From static Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New(const Foam::polyMesh&, const Foam::IOdictionary&)
        in file motionSolvers/motionSolver/motionSolver.C at line 137.
    
    FOAM exiting
    

    image.png


  • mesh_.C()[celli]编译报错
    liujmL liujm

    @coolhhh 厉害,测试代码copy了。不过,这里直接操作就又可以了:wocao:


  • mesh_.C()[celli]编译报错
    liujmL liujm

    @coolhhh
    感谢解答,我之所以直接操作mesh.C(),是因为我在源码中搜到了这种用法,OF2012

    a1b14142-f9bc-4f61-bedf-57f7f70174c1-image.png


  • 为什么我在用致动线模型算的时候得到的涡量图和文献中不一样
    liujmL liujm

    @卡洛 卡老师,能分享一下边界条件的修改思路吗:140:


  • mesh_.C()[celli]编译报错
    liujmL liujm

    mesh_.C()
    mesh_.C().primitiveField()
    mesh_.C().internalField()
    mesh_.C().boundaryField()
    这四个返回值之间的区别是什么呢?


  • mesh_.C()[celli]编译报错
    liujmL liujm

    各位前辈大家好,

    我在使用const vector cellCentre = mesh_.C()[celli]收集网格中心坐标时,编译器出现报错:

    In file included from cfdTools/general/porosityModel/floatingDarcyForchheimer/floatingDarcyForchheimer.H:216,
                     from cfdTools/general/porosityModel/floatingDarcyForchheimer/floatingDarcyForchheimer.C:30:
    cfdTools/general/porosityModel/floatingDarcyForchheimer/floatingDarcyForchheimerTemplates.C: In member function ‘void Foam::porosityModels::floatingDarcyForchheimer::applyInCalcForce(Foam::scalarField&, Foam::vectorField&, const scalarField&, const RhoFieldType&, const scalarField&, const vectorField&, Foam::vectorField&) const’:
    cfdTools/general/porosityModel/floatingDarcyForchheimer/floatingDarcyForchheimerTemplates.C:119:48: error: no match for ‘operator[]’ (operand types are ‘const volVectorField’ {aka ‘const Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>’} and ‘const label’ {aka ‘const int’})
      119 |             const vector cellCentre = mesh_.C()[celli];
          |  
    

    貌似mesh_.C()返回的数据类型不支持使用[]符号,可是为什么在其他代码中就可以这样使用 mesh_.C()[celli]呢?

    后期,我通过使用const vector cellCentre = mesh_.C().primitiveField()[celli]通过编译。不过尚不清楚其与mesh_.C()返回的结果是否存在差异。

    烦请各位老师解答~


  • 计算作用于cellZone上的压力和剪切力
    liujmL liujm

    已经想到合适的解决方案啦! 封楼


  • 计算作用于cellZone上的压力和剪切力
    liujmL liujm

    @李东岳 李老师,这也正是我遇到的问题:136: 。

    退一步我做一个简化,在图示的myForces.H的结构最外层cell上套一层patch边界,可不可以仅用patch计算cellZone最外层网格的力和力矩[1],而不阻碍水体穿越被patch包裹的cellZone区域?

    这个想法可行吗,如果可行的话老师方便指点一下,如何实现水体不穿越patch的功能?

    [1] 只计算外层网格表面的受力是因为网衣通常不会太厚,有文献采用2m厚的多孔介质模型,网格尺寸0.5m来模拟。

    在OF2206中,
    对于patch,有addToPatchFields函数:

    void Foam::functionObjects::forces::addToPatchFields
    (
        const label patchi,
        const vectorField& Md,
        const vectorField& fP,
        const vectorField& fV
    )
    {
        sumPatchForcesP_ += sum(fP);
        sumPatchForcesV_ += sum(fV);
        force().boundaryFieldRef()[patchi] += fP + fV;
    
        const vectorField mP(Md^fP);
        const vectorField mV(Md^fV);
    
        sumPatchMomentsP_ += sum(mP);
        sumPatchMomentsV_ += sum(mV);
        moment().boundaryFieldRef()[patchi] += mP + mV;
    }
    

    对于多孔介质的cellZone,有addToInternalField函数:

    void Foam::functionObjects::forces::addToInternalField
    (
        const labelList& cellIDs,
        const vectorField& Md,
        const vectorField& f
    )
    {
        auto& force = this->force();
        auto& moment = this->moment();
    
        forAll(cellIDs, i)
        {
            const label celli = cellIDs[i];
    
            sumInternalForces_ += f[i];
            force[celli] += f[i];
    
            const vector m(Md[i]^f[i]);
            sumInternalMoments_ += m;
            moment[celli] = m;
        }
    }
    

  • 计算作用于cellZone上的压力和剪切力
    liujmL liujm

    @李东岳 老师,我想要模拟浮式多孔介质模型在流体中的运动,因此需要获得物体的力(矩),这里的剪切力其实对应一楼【代码片段1】的54行和56行。


  • 计算作用于cellZone上的压力和剪切力
    liujmL liujm

    @李东岳 老师,可以直接对区域内的所有cell压力求积分得出吗?其实这篇帖子是这个帖子的延申:136: 。
    一方面,要保证动网格能够识别到patch名,另一方面也要计算cell上的力,请问李老师有没有更好的实现方法?


  • 计算作用于cellZone上的压力和剪切力
    liujmL liujm

    总体而言,就是要计算cellZone所有网格上的法向力和切向力,而不是仅仅计算作用在固壁边界上的力。
    这里通过图示表达目的:
    33bdd489-1a5e-4b96-ac6f-a108a9ffa9b9-e2bfe6413bc5c6eecfc0b65a00b3268.jpg

  • 登录

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