CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Rotating Disc Systems with SonicTurbFoam (

mhuening January 2, 2007 13:38

Hello all together, 1.) A v
Hello all together,

1.) A view days ago, I wrote Mattijis an e-mail. I asked him for advice to run the Naca Profile with the SonicTurbFoam Solver. These solver only shows the banner if I run it on my machine (Same Result with other Test Cases). Other Solvers like icoFoam are working. He gave me the tip to use gdb to debug the code. Can Someone give me a brief explanation: How I can do this workmanlike if I don't have experience with that debugger?

2.) I want calculate Rotating Disc Systems. Therefore I have to model a disc with a constant rotating shaft speed. In older discussions I found a code like ... to set the boundary condition (wall speed as function of radius):

lable patchID = mesh.boundaryMesh().findPatchID(nameofRotatingSurf ace);
const fvPatch& cPAtch = mesh.boundaryMesh()[patchID];
const vectorField& faceCenters = cPatch.Cf();
U.boundaryField()[patchID] = some function of face Centers;


Does anybody know in which *.H file I should implement a code like this?



mhuening January 4, 2007 12:44

Hello all together, hello Matt
Hello all together, hello Mattijs

a view days ago I posted a question to the massage board about implementing rotating disc surfaces into OpenFoam. I tried to implement the following code into turbFoam.C:

/************************************************** **************************/
label patchID = mesh.boundaryMesh().findPatchID("rotor");

const polyPatch& cPatch = mesh.boundaryMesh()[patchID];

const vector& faceCoord = cPatch.faceCenters(); // line 60
vector faceU(vector::zero);
faceU.x() = 0;
faceU.y() = 0;
faceU.z() = faceCoord.component(1)*1000;
U.boundaryField()[patchID][facel] = faceU;
/************************************************** **************************/

I got the error ...

turbFoam.C: In function 'int main(int, char**)':
turbFoam.C:60: error: 'const class Foam::polyPatch' has no member named 'faceCenters'

Does someone knows the structures of the code as good that he directly sees my mistake?

Thanks Marcus

gschaider January 4, 2007 19:38

Marcus. Try faceCentres ins

Try faceCentres instead of faceCenters (British English, not American)

All times are GMT -4. The time now is 18:33.