I am trying to solve a problem, where I have a closed hollow cylinder filled with fluid. The curved surfaces of the cylinder rotate at a speed of 1m/s.

This is my U file. Is the code correct?

internalField uniform (0 0 0);

boundaryField

{

movingWall1

{

type codedFixedValue;

value uniform (1 0 0);

name tangVelocity;

code

#{

const vectorField& Cf =patch().Cf();

vectorField& field = *this;

const scalar r = 1;

forAll(Cf, faceI)

{

const scalar x=Cf[faceI][0];

const scalar y=Cf[faceI][1];

field[faceI]=vector(y/r,-x/r,0);

}

#};

}

movingWall2

{

type codedFixedValue;

value uniform (0 1 0);

name tangVelocity;

code

#{

const vectorField& Cf =patch().Cf();

vectorField& field = *this;

const scalar r = 1;

forAll(Cf, faceI)

{

const scalar x=Cf[faceI][0];

const scalar y=Cf[faceI][1];

field[faceI]=vector(y/r,-x/r,0);

}

#};

}

movingWall3

{

type codedFixedValue;

value uniform (1 0 0);

name tangVelocity;

code

#{

const vectorField& Cf =patch().Cf();

vectorField& field = *this;

const scalar r = 1;

forAll(Cf, faceI)

{

const scalar x=Cf[faceI][0];

const scalar y=Cf[faceI][1];

field[faceI]=vector(y/r,-x/r,0);

}

#};

}

movingWall4

{

type codedFixedValue;

value uniform (0 1 0);

name tangVelocity;

code

#{

const vectorField& Cf =patch().Cf();

vectorField& field = *this;

const scalar r = 1;

forAll(Cf, faceI)

{

const scalar x=Cf[faceI][0];

const scalar y=Cf[faceI][1];

field[faceI]=vector(y/r,-x/r,0);

}

#};

}

fixedWalls

{

type noSlip;

}

frontAndBack

{

type empty;

}

}

// ************************************************************************* //

OpenFOAM

For walls rotating walls, OpenFOAM has an in-built boundary condition of type 'rotatingWallVelocity'. Did you already try this?

https://www.openfoam.com/documentation/guides/latest/api/classFoam_1_1rotatingWallVelocityFvPatchVectorField.html

The tutorial in the link below should also help you understand this boundary condition better.

https://www.openfoam.com/documentation/guides/latest/doc/verification-validation-rotating-cylinders-2d.html

Regards,

Ashley

Ashley, I've been following your question, and I am not sure what is the problem with your code... have you find the problem?

Antonio,

Public Toilet Near Me

I get an error.

cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/rotatingCylinders .

cp: cannot stat '/opt/OpenFOAM-v2106/tutorials/incompressible/simpleFoam/rotatingCylinders': No such file or directory

24-11-21, 2:41 p.m.Krishna_DeshmukhThe tutorial can be found in an older version of OpenFOAM. But another demostration can be found in the document below.

https://rheologic.net/sites/default/files/pdf/taylor_couette_tutorial-20160913.pdf

Regards,

Ashley

24-11-21, 3:44 p.m.ashleymelvinLogin to add comment