define a new boundary condition
Hi FOAMers,
I want to implement a new boundary condition : Tinlet=(averaged Toutlet)*lambda, where lambda is constant. so how to implement it. |
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 |
Quote:
Code:
variables ( |
All times are GMT -4. The time now is 05:25. |