|
[Sponsors] |
December 24, 2012, 08:44 |
define a new boundary condition
|
#1 |
New Member
Maosong Cheng
Join Date: Aug 2012
Posts: 19
Rep Power: 13 |
Hi FOAMers,
I want to implement a new boundary condition : Tinlet=(averaged Toutlet)*lambda, where lambda is constant. so how to implement it. |
|
December 30, 2012, 12:54 |
|
#2 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
You need to implement fixedValue B.C., (create derived class, like lambdaTInletFvPatchScalarField for example). Then in method lambdaTInletFvPatchScalarField::updateCoeffs() You must implement something like that
//init some intermediate variables ......... ......... const volScalarField& T = mesh.lookupObject<volScalarField>("T"); outPatchId = mesh.boundaryMesh().findPatchID("outlet"); scalar ToutAv = gSum(T.boundaryField()[outPatchId]*mesh.magSf().boundaryField()[outPatchId]) / gSum(mesh.magSf().boundaryField()[outPatchId]); scalarField Tinlet (this->size(), ToutAv*lambda_); operator == (Tinle); fixedValueFvPatchField<scalar>::updateCoeffs(); This B.C. must be implemented in a new dynamic library, which You can link to solver in file fvSolution/controlDict |
|
January 5, 2013, 18:46 |
|
#3 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
variables ( "Tout{outlet}=average(T);" "lambda=0.5;" ); valueExpression "lambda*Tout";
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation interface | hinca | CFX | 15 | January 26, 2014 17:11 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 17:44 |
how to define two inlet boundary condition at the different time | nuengao | FLUENT | 0 | December 13, 2010 02:42 |
External Radiation Boundary Condition for Grid Interface | CFD XUE | FLUENT | 0 | July 9, 2010 02:53 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 12:24 |