|
[Sponsors] |
Custom gradient boundary condition in open Foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 28, 2022, 07:47 |
Custom gradient boundary condition in open Foam
|
#1 |
New Member
ghanashyam k c
Join Date: May 2022
Posts: 4
Rep Power: 3 |
For a particular boundary, I need to code the gradient variation as a boundary condition. So that gradient is actually a function of the x coordinate. For every point, this gradient will vary. I've tied to code this with the help of codedMixed. But it doesn't work. I've given my expression below....if it is possible, could someone correct this?
Pressure_outlet { type codedMixed; name logarithamicvoltage1; refValue uniform 0; refGradient uniform 0; valueFraction uniform 0; code #{ const fvPatch& boundaryPatch = this->patch(); const vectorField& Rf = boundaryPatch.Cf(); const label& patchLabel = boundaryPatch.index(); scalarField& Field = *this; forAll(Rf, facei) { const scalar p = Rf[facei].x(); const scalar q = Rf[facei].y(); Field[facei]=1645*(-0.1103)*((1/pow(876.818+pow(p/9.004095e-5,2),0.5)) + (1/pow(999.262+pow(p/9.004095e-5,2),0.5))); } this->refGrad()=Field ; #}; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SimpleFoam cannot open include file | Marija | OpenFOAM Running, Solving & CFD | 1 | October 28, 2020 10:35 |
Wind turbine simulation | Saturn | CFX | 58 | July 3, 2020 01:13 |
error with reactingFoam | BakedAlmonds | OpenFOAM Running, Solving & CFD | 4 | June 22, 2016 02:21 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 13:59 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 14:00 |