CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding a BC for pointPatchField/tetPolyPatchField (http://www.cfd-online.com/Forums/openfoam-programming-development/120145-adding-bc-pointpatchfield-tetpolypatchfield.html)

hannes July 1, 2013 11:30

Adding a BC for pointPatchField/tetPolyPatchField
 
Hello,

I just came across some strange problem which I could not solve yet. Maybe someone has a hint for me:

I have created some user defined BC which I want to use in the "pointDisplacement" field of the fvMotionSolver as well as in the "motionU" field of the tetDecomposition motion solver. I therefore templated the class:

Code:

template
<
  template<class> class PatchField,
    class Mesh,
    class PointPatch,
  template<class>  class MatrixType
>
class FEMDisplacementPatchVectorField
:
    public FixedValuePointPatchField
    <
        PatchField,
        Mesh,
        PointPatch,
        MatrixType,
        vector
    >
{
....
};

Then I have instantiated the BC for the pointPatchField which works as expected:
Code:

typedef
FEMDisplacementPatchVectorField<pointPatchField, pointMesh, pointPatch, DummyMatrix>
FEMDisplacementPointPatchVectorField;

makePointPatchTypeField
(
    fixedValuePointPatchVectorField,
    FEMDisplacementPointPatchVectorField
);

The same works also for the tetPolyPatchField (with either CELL_DECOMP or FACE_DECOMP defined):
Code:

typedef
FEMDisplacementPatchVectorField<tetPolyPatchField, tetPointMesh, tetPolyPatch, tetFemMatrix>
FEMDisplacementTetPolyPatchVectorField;


makePointPatchTypeField(tetPolyPatchVectorField, FEMDisplacementTetPolyPatchVectorField);

The strange thing is: if I compile with "FACE_DECOMP", everything seems ok i.e. I can select the BC in the "motionU" file. But if I compile with "CELL_DECOMP", the code compiles well, but I cannot select the BC in the field file. My BC class is then not contained in the selection table.
As far as I understand, there should be nothing changed in my code except than defining the appropriate preprocessor symbol. Or do I miss something?

Thanks for any hint.

Best regards, Hannes

achyutan July 17, 2013 09:39

Hi hannes,

case 1 : if you have compiled your new boundary condition under openfoam src, then you have to include that executable/ .so file in controlDict of your case.

case 2 : if not as mentioned above, i.e. if you have compiled your b.c separately, you have to recompile your solver by including the new bc file in its header and changing files and options appropriately.

from what i understand based on ur post, case 1 is the solution. hope this helps..
regards,
achyutan


All times are GMT -4. The time now is 03:19.