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. output value vs paraFoam?

output value vs paraFoam?

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

    I am checking that the variables outbut from source code in solver and I found the differences between output and paraFoam. I cannot understand why it happened? The follow is my codes in simpleFoam.C:
    **const dimensionedScalar myZero("myZero", dimensionSet(0,0,0,0,0,0,0),scalar(0) );

    volScalarField k0=myZeroturbulence->k();
    volScalarField nut0=myZero
    turbulence->nut();
    volScalarField nu0=myZero*turbulence->nu();

    const label patchID = mesh.boundaryMesh().findPatchID("wall");
    const tmp<scalarField> tnuw = turbulence->nu(patchID);
    const scalarField& nuw = tnuw();

    const tmp<scalarField> tnutw = turbulence->nut(patchID);
    const scalarField& nutw = tnutw();

    const fvPatchVectorField& Uw = turbulence->U().boundaryField()[patchID];

    const scalarField magGradUw(mag(Uw.snGrad()));

    for (int j=0; j<nut0.size(); j++)
    {
    if (j<=(nutw.size()/2-1)) {nut0[j]=nutw[j]; nu0[j]=nuw[j];}
    if (j>=(mesh.cells().size()-nutw.size()/2)&&j<=mesh.cells().size()-1) {nut0[j]=nutw[j-(mesh.cells().size()-nutw.size())];nu0[j]=nuw[j-(mesh.cells().size()-nutw.size())];}
    }

    volVectorField Uww=U*myZero;
    const fvPatchList& patches = mesh.boundary();
    labelList wallList;
    wallList.clear();

    forAll(patches, patchi)
    {
    const fvPatch& curPatch = patches[patchi];
    if (isType<wallFvPatch>(curPatch))
    {
    forAll(curPatch, facei)
    {
    label faceCelli = curPatch.faceCells()[facei];
    wallList.resize(wallList.size()+1);
    wallList[wallList.size()-1]=faceCelli;
    }
    }
    }

    forAll(wallList,i)
    {

    Uww[wallList[i]] = U[wallList[i]];

    }

    volScalarField uz = Uww.component(vector::Z);
    volVectorField SG = uz*vector(0,0,1);
    volScalarField magGradUww=mag(SG)/myY;

    k0=((nut0+nu0)*magGradUww/0.3);

    Info<<"k0="<<k0<<endl;
    Info<<"nut0="<<nut0<<endl;
    Info<<"nutw="<<nutw<<endl;
    Info<<"magGradUww="<<magGradUww<<endl;
    Info<<"magGradUw="<<magGradUw<<endl;
    Info<<"tauw="<<(nut0+nu0)magGradUww<<endl;
    Info<<"Uw="<<Uw<<endl;
    *

    nutw and magGradUw are copied from nutkwallfunction. In the end, wallshearstress in the paraFoam is not the same as (nut0+nu0)*magGradUww.

    1 条回复 最后回复

  • 登录

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