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

zeroGradient (velocity) within codedFixedValue

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2022, 04:53
Default zeroGradient (velocity) within codedFixedValue
  #1
Senior Member
 
Giles Richardson
Join Date: Jun 2012
Location: Cambs UK
Posts: 102
Rep Power: 14
ufocfd is on a distinguished road
I am trying to specify a zeroGradient (velocity) within the codedFixedValue BC. I have done it something like this (snippet below) but it doesnt seem to work - at least Im not getting a zero gradient at the downstream boundary - any ideas (please) - have I made a mistake or missed something? Thanks.

// get velocity field
const volVectorField& U = db().lookupObject<volVectorField>("U");

forAll(Cf,facei) // face loop
{
// get index of cell adjacent to patch face
label celli = patch().faceCells()[facei];

//--------zeroGradient downstream
field[facei] = U[celli]; // Uface = Ucell

}
ufocfd 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
codedFixedValue to couple velocity and pressure? seilgu OpenFOAM Running, Solving & CFD 0 March 20, 2022 04:13
serial udf to parallel udf radioss Fluent UDF and Scheme Programming 10 January 19, 2019 09:56
Velocity in Porous medium : HELP! HELP! HELP! Kali Sanjay Phoenics 0 November 6, 2006 07:10
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


All times are GMT -4. The time now is 00:09.