activePressureForceBaffleVelocity/activeBaffleVelocity边界条件如何使用
-
需求:在一个管子中间有一个阀门,压力大于一定值后阀门打开
我在李东岳老师的建议下尝试使用activePressureForceBaffleVelocity/activeBaffleVelocity边界条件实现上述功能。查阅资料发现实现该功能需要在目标位置创建4个面(两个wall,两个cyclic),经过许多尝试,代码能够运行不报错,但是结果有明显问题。初始时刻的各种场出现诡异变化,如图所示。部分关键文件进行上传,请大佬帮忙指正错误。p.orig T.orig U.orig blockMeshDict createBafflesDict createPatchDict topoSetDict/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { cylinder1_wall_down { type noSlip; } interface { type noSlip; } cylinder1_wall_sides { type noSlip; } blockedRaptureDiscBaffle { type activeBaffleVelocity;//activePressureForceBaffleVelocity; // This is the name of the cyclic patch cyclicPatch raptureDisc_master; openingTime 0.01; maxOpenFractionDelta 1; openFraction 0; orientation -1; // This value is the opening or closing guy // Please see ISSUE 2360 - Bug in condition // https://develop.openfoam.com/Development/openfoam/-/issues/2360 // -> if you dont have the patch installed, the BC will open at 3000 Pa minThresholdValue 210000; forceBased false; opening 1; value uniform (0 0 0); } raptureDisc_master { type cyclic; } raptureDisc_slave { type cyclic; } } // ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2106 | | \\ / A nd | Website: | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2012; format ascii; class dictionary; location "system"; object createBafflesDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // internalFacesOnly true; //noFields true;//false fields true; baffles { // Here we use the previous created faceSet to create 4 times the same // faces which are moved to different boundary conditions // The reason for that is that the activePressureForceBaffle needs // a) a cyclic boundary set (master/slave) // b) an additional wall quadruplicateTheInternalFaces { type faceZone; zoneName baffleFaces; patches { // a) Create the cyclic guys (RD = raptureDisc) RD_master_cyclic { name raptureDisc_master; type cyclic; sampleMode nearestPatchFace; neighbourPatch raptureDisc_slave; sameGroup off; patchFields { } } RD_slave_cyclic { name raptureDisc_slave; type cyclic; sampleMode nearestPatchFace; neighbourPatch raptureDisc_master; sameGroup off; patchFields { } } // b) create another set of walls (will be merged in the next step) RD_master_wall { name raptureDiscWall1; type wall; } RD_slave_wall { name raptureDiscWall2; type wall; } } } } // ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2106 | | \\ / A nd | Website: | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // pointSync false; // Patches to create. patches ( { // Name of new patch name blockedRaptureDiscBaffle; // Dictionary to construct new patch from patchInfo { type wall; } // How to construct: either from 'patches' or 'set' constructFrom patches; patches (raptureDiscWall1 raptureDiscWall2); } ); // ************************************************************************* //