0
Is my code correct?

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 21-11-21, 10:38 p.m. Krishna_Deshmukh
0
Hi,

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
22-11-21, 1:57 p.m. ashleymelvin

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_Deshmukh

The 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. ashleymelvin

Login to add comment


0

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

 

15-12-21, 1:32 p.m. Antonios


0
This hollow cylinder problem has really got me all confused to be honest. I first came across this problem while surfing on https://myassignments-help.com.au/essay-writing-services/. Ever since then, I've been looking for a way to solve it but haven't been able to found anything for that.
19-01-22, 12:22 a.m. ZaynSalvador


Log-in to answer to this question.