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

Manually modifying boundary condition

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 29, 2010, 04:03
Default Manually modifying boundary condition
  #1
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 8
johndeas is on a distinguished road
Hi,

I would like to change the value of a Dirichlet boundary condition at just one point. I already know the label of the face at which I would like the change (in the global numbering of faces).

I would like an overall idea of the logic of what to do: which classes, members function to use.

Thanks
johndeas is offline   Reply With Quote

Old   April 5, 2010, 16:16
Default
  #2
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 8
johndeas is on a distinguished road
Hi,

Based on the information provided on post Parabolic inlet velocity profile , I used the following piece of code to fix the temperature at a specific point at the boundary:

Code:
vector locFace(0.2,0,0.02);

label patchID = mesh.boundaryMesh().findPatchID("down"); 
const polyPatch& cPatch = mesh.boundaryMesh()[patchID];
const vectorField& FaceCentres = cPatch.faceCentres(); 

label T2Face=0;
scalar currDist=mag(FaceCentres[0] - locFace);    

forAll(FaceCentres,i) // in each proc, local loop over boundary faces of "inlet"
{
    if (mag(FaceCentres[i] - locFace) < currDist)
    {
        currDist = mag(FaceCentres[i] - locFace);
        T2Face = i;
    }
}

T.boundaryField()[patchID][T2Face]=350;
Now, I would like to use a fixedGradient condition, which value won't be set using T.boundaryField()[patchID][T2Face]. How can I fix the value of the gradient at a particular point ?

Thanks
johndeas is offline   Reply With Quote

Reply

Tags
boundary conditions, dirichlet

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How exactly the "pressure outlet" bdry condition compute properties on the boundary? yating9901 FLUENT 3 June 28, 2010 12:26
Transient outlet boundary condition problem jwillie2000 CFX 1 December 7, 2009 18:07
Axis Boundary Condition..what is it? CFDtoy FLUENT 6 February 13, 2007 06:51
How to set boundary condition in Fluent for the fo Peiyong FLUENT 1 November 10, 2006 12:44
How to resolve boundary condition problem? sam FLUENT 2 July 20, 2003 02:19


All times are GMT -4. The time now is 06:33.