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

J

Junren Hou

@Junren Hou
关于
帖子
4
主题
1
群组
0
粉丝
0
关注
0

帖子

最新

  • ICEM划分网格
    J Junren Hou

    真有用?


  • ICEM划分网格
    J Junren Hou

    可以试试check block,有些时候其实没有问题,就它软件自己的毛病,然后block里最后有一个check block,可以让他自己检查一下。里面有好多选项,都试试,什么check/fixed block


  • codedFixedValue中如何获得主程序中的常量或者从边界条件里的dict获得
    J Junren Hou

    谢谢岳哥,成了,牛牛牛


  • codedFixedValue中如何获得主程序中的常量或者从边界条件里的dict获得
    J Junren Hou

    我想在codedFixedValue中的获得主程序中的常量,比如下面这个边界条件里。

            type       codedFixedValue;
            value     uniform 0;
            name     f4_f2;
            code
            #{
                const fvPatch& boundaryPatch = patch();
                scalar c = 0.5;
                scalar cs2 = 3.0/c/c;
                scalar cs4 = 4.5/c/c/c/c;
                dimensionedVector U4("U4", dimensionSet(0, 0, 0, 0, 0), vector(0, -c, 0));
                fvPatchField<scalar> f4 = boundaryPatch.lookupPatchField<volScalarField,scalar>("f4");
                const fvPatchField<scalar> rho = boundaryPatch.lookupPatchField<volScalarField,scalar>("rho");
                const fvPatchField<vector> U = boundaryPatch.lookupPatchField<volVectorField,vector>("U");
                const scalarField f4Internal = boundaryPatch.lookupPatchField<volScalarField,scalar>("f4").patchInternalField();
                const scalarField rhoInternal = boundaryPatch.lookupPatchField<volScalarField,scalar>("rho").patchInternalField();
                const vectorField UInternal = boundaryPatch.lookupPatchField<volVectorField,vector>("U").patchInternalField();
                dimensionedScalar feq4;
                dimensionedScalar feq4Internal;
                forAll(boundaryPatch, faceI)
                {
                    feq4 = rho[faceI]*1.0/9.0*(1.0+cs2*(U4&U[faceI])+cs4*(U4&U[faceI])*(U4&U[faceI])-cs2/2*(U[faceI]&U[faceI]));
                    feq4Internal = rhoInternal[faceI]*1.0/9.0*(1+cs2*(U4&UInternal[faceI])+cs4*(U4&UInternal[faceI])*(U4&UInternal[faceI])-cs2/2*(UInternal[faceI]&UInternal[faceI]));
                    f4[faceI] = feq4.value() + f4Internal[faceI] - feq4Internal.value();
                }
                operator==(f4);
            #};
    

    c在求解器里通过transportProperties进行了定义,我想获得它。

    dimensionedScalar c
    (
        "c",
        dimensionSet(0, 0, 0, 0, 0, 0, 0),
        transportProperties
    );
    

    如果不行,退而求其次,能否在边界条件里,通过设置c value;来获得呢,这样就不用每次改c值都得重新编译边界条件了。就像下面这个图里的样子

    a10a94f9-d045-440b-9ac5-3fe424eb89ea-image.png

    用的OpenFOAM-v2012

  • 登录

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