![]() |
Boundary condition
Hi all,
For my computations I need to specify a special boundary condition for U at the inner wall, so that I can set Ux and Uy to fixedValue and Uz to zeroGradient. But a I don't have experience in creating new boundary conditions, so at the moment I don't know how to realize this. I found something to read about creating new boundary conditions but nothing about boundary conditions which allow to specify a value for each of the three components of U. Can somebody help me? Or is there already such a boundary condition in OF 1.6? Thanks, Jennifer |
Hi Jennifer,
I think the directionMixedBC should be able to do this job. Good luck Stefan |
Hi Stefan,
thanks for your answer. I had a look on directionMixed BCs, but now I don't understand how to use them :( Can you perhaps give me an example or explain me how to use this boundary condition? Jennifer |
Hi Jennifer,
this boundary condition is a blending between fixedValue and fixedGradient. The syntax is as follows Code:
type directionMixed;refValue: components of U needed for fixedValue refGradient: components of gradient needed for fixedGradient valueFraction: symmetric tensor which indicates if BC for a component is fixedValue (1) or fixedGradient (0) An easy example: Think about an outlet where you want the normal component of U (e.g. z-Direction) to be zeroGradient but the other components to be zero. Then the syntax is: Code:
type directionMixed;Good luck Stefan |
directionMixed for symmTensor
Stefan,
Thank you for this concise explanation of directionMixed. I am having some difficulty understanding how this boundary condition might be applied to a symmetric tensor. I'd like to be able set certain components of the tensor to be zeroGradient in the normal direction (Y, in my case), while setting the rest of the components to be fixedValue. I've tried several different variations and searched the forums with little success. Say I want the XY, YY, and YZ components of my symmTensor to have a fixedValue of 7, while the XX, XZ, and ZZ be zeroGradient. Supposing my tensor started as Code:
[1 1 1 1 1 1]Code:
Code:
[7 21 7 67 21 7]Code:
[1 7 1 7 7 1]Is this even possible to do in the current implementation of directionMixed? Thank you in advance, Mike P.S. - I tried this with a vector and it worked brilliantly: Code:
|
Answered my own question, sort of
After digging in to /src/OpenFOAM/primitives/transform/symmTransform.H I discovered that, when operating on a symmTensor, this boundary condition does the following:
For given symmTensors valueFraction, refValue, and refGradient along with the value of the symmTensorField at this patch ( this->patchInternalField(), which I'll call R for short ), directionMixed will return Code:
Code:
gradValue = R(internalField) - refGradient / dxSo, this explains the unexpected results above, but still leaves me wondering if it is possible to achieve the BC I need without writing my own. Any suggestions? |
UPDATE: It turns out that it is not possible (to my knowledge) to achieve the desired BC using mixedDirection. I am now working on "groovifying" this BC to extend its functionality.
Mike |
| All times are GMT -4. The time now is 15:57. |