CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Custom gradient boundary condition in open Foam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 28, 2022, 07:47
Default Custom gradient boundary condition in open Foam
  #1
New Member
 
ghanashyam k c
Join Date: May 2022
Posts: 4
Rep Power: 3
gsam is on a distinguished road
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 ;

#};
}
gsam is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 01:16.