|
[Sponsors] |
July 31, 2020, 08:11 |
codedMixed condition - not applied
|
#1 |
New Member
S
Join Date: Jul 2020
Posts: 1
Rep Power: 0 |
Hi All,
I am trying to build a heat transfer case with chtMultiRegionSimpleFoam and use the codedMixed boundary condition below. The code compiles fine and produces a .so. However, it seems that it is never called. The default refValue, refGradient and valueFraction are applied, and whatever I change in the code (provided that it compiles) does not affect the boundary value. None of my prints shows in the log. Is there anything wrong with my boundary? The p boundary file has the following entry: Code:
Bottom { type codedMixed; refValue uniform 0; refGradient uniform 0; name hydrostaticBottomGradient; valueFraction uniform 1; code #{ printMessage("CODED MIXED IN"); Info << "CODED MIXED IN" << endl; const fvPatch& boundaryPatch = patch(); const fvBoundaryMesh& boundaryMesh = boundaryPatch.boundaryMesh(); const fvMesh& mesh = boundaryMesh.mesh(); const label patchid = mesh.boundary().findPatchID(this->patch().name()); const volScalarField& rho(mesh.lookupObject<volScalarField>("rho")); const auto& rhoPatchField = rho.boundaryField()[patchid]; scalarField& val = this->refValue(); scalarField& grad = this->refGrad(); scalarField& frac = this->valueFraction(); const vectorField& Cf = patch().Cf(); // Get centre coordinate (we don't use it actually); forAll(Cf, facei) // face loop { grad[facei] = 9.81 * rhoPatchField[facei]; val[facei] = 200000.; frac[facei] = 1; Info << "Set val to: " << val[facei] << " for face " << facei << endl; } #}; } |
|
September 3, 2020, 05:54 |
|
#2 |
Member
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 96
Rep Power: 16 |
Have you tried working with something like
Code:
this->refGrad() = 9.81 * rho.boundaryField()[patchid]; And at the moment you are prescribing a fixedValue only, meaning all values will be set to 200000. Is this intended? To use fixedGradient, you have to set valueFraction to 0. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX fails to calculate a diffuser pipe flow | shenying0710 | CFX | 7 | March 26, 2013 05:13 |
Boundary condition clarification | shaswat | CFX | 1 | April 8, 2012 05:06 |
Airfoil boundary condition | Frank | Main CFD Forum | 1 | April 21, 2008 19:36 |
Pressure Boundary Condition | Matt Umbel | Main CFD Forum | 0 | January 11, 2002 11:06 |
The Boundary Condition about the Flat Plate | boing | Main CFD Forum | 1 | January 6, 2002 17:53 |