CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problems implementing a boundary condition (http://www.cfd-online.com/Forums/openfoam-solving/59564-problems-implementing-boundary-condition.html)

ogloth July 17, 2007 13:22

Hello, I am trying to imple
 
Hello,

I am trying to implement a custom boundary condition. The class has a member field like this:

scalarField foo;

When reading from the dictionary it gets initialised with the correct values, but the first time that updateCoeffs() is called the field foo is reverted back to all zeros ...

Another question about boundary conditions: What exactly are the mapping functions doing?

Any help would be appreciated!

Thanks,
Oliver

hjasak July 17, 2007 13:44

Another question about bound
 
Quote:

Another question about boundary conditions: What exactly are the mapping functions doing?
On change of topology, the boundary condition needs to map itself from the old to the new mesh. Since on the outside we don't know what data the boundary condition holds, it needs to map itself.

Clear?

Hrv

ogloth July 17, 2007 14:46

Yep, that makes sense - for no
 
Yep, that makes sense - for now I copied that part from the total pressure condition.

'still trying to find why it is reset to zero, though.

ogloth July 17, 2007 15:36

I checked and the instance of
 
I checked and the instance of my boundary condition that gets used has not been constructed with the constructor that takes a dictionary as argument. Actually it was constructed with:

className(const fvPatch&, const scalarField&)

Did I forget to overload a copy-operator or something in that league? I checked the total-pressure boundary condition, but there is no copy operator

...

I'm stuck :-(


All times are GMT -4. The time now is 12:10.