CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   cellSet - Divide Patch Wall in Pipe for implementation different BCs (

franzi_ May 12, 2012 11:20

cellSet - Divide Patch Wall in Pipe for implementation different BCs

I am using the forum since quite a long time now and always found really helpful posts, but to this topic I couldn't find what I was looking for.

I want to simulate the flow through a pipe with a constant wall tempreture on the outer wall. But in fact only part of the wall has a constant wall temperatur. On the pipe the first 40mm are adiabatic, than 60mm konst temp., again 40mm adabaitc and so on. (16 times)
- I hope I explained it understandable.

I tried to use createPatch und cellSetDict ( // Cells with centre within cylinder: cylinderToCell)to form that shape but it didn't work.

For the mesh I use Salome, but in fact it is overcharged with that mesh.

Does anyone have a hint what else I could try for this problem? Is there any other utility I still havn't found?

I really hope that somebody has a good idea.

Thanks a lot in advance
cheers, Franzi

PS: I am using OF 1.7.

nimasam May 13, 2012 07:18

ur answer is "groovyBC", you dont need to divide your patch you can apply your non uniform boundary condition with groovyBC

you can download it from here: " "

franzi_ May 13, 2012 08:54


Thanks a lot for the fast answer!!!

I already usw groovyBC for the BC Temperature on the wall like this:
type groovyBC;
variables "h=109.0;Tinf=494.0;rho=777.0;cp=2200.0;k=kappaEff *cp*rho;";
valueExpression "Tinf";
fractionExpression "1.0/(1.0+k/(mag(delta())*h))";

But I don't see any way to put in a condition. I want that half of the tube has the groovyBC condition as defined above und is other half zeroGradient for an adiabatic wall. Can I set something like -condition "pos().z>0.4 && pos().z<0.6" for the wall in groovyBC?

What about swak4Foam? I saw it in the forum and wonder if I can use that to make zeroGradient for different positions on the wall. But that only sets initial values, right ? no BCs that stays constant while simulating?

Oh, I am really confused at the moment...

Thanks in advance for helping!

Cheers Franzi

nimasam May 13, 2012 10:04

somethings like this:

valueExpression "pos().z > L ? 0 : T";
gradientExpression "pos().z > L ? q : 0";

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