CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Slip boundary around circles (https://www.cfd-online.com/Forums/openfoam-solving/58485-slip-boundary-around-circles.html)

zhoubinwx July 29, 2008 06:50

Dear all, My simple 2-D incom
 
Dear all,
My simple 2-D incompressible case: in a rectangle, there are three circles(randomly), and the flow is around these circles.

Now let us suppose this kind of slip boundary:
Ux(yc - y)^2= ∂Ux/∂x*d
where Ux means the x-component of the velocity U at the circle surface(x,y);
yc means the y-coordinate of the circle center;
d means the circle diamter;

Would you please kindly give me some suggestion the method of setting this kind of "slip"? Because I do not know how to get the grid coordinates around the circle, the circle center coordinates, the diameter, and ux, as well as ∂Ux/∂x.

I do now know how could I apply my supposed boundary.

I looked at the userguide, to find that there is slip and partial slip boundaries, depending on the slip valueFraction. Is anyone who know which file is used for this setting?

Thank you for your attention.

Bin

ngj July 29, 2008 07:17

Hi Bin Suppose that all of
 
Hi Bin

Suppose that all of the circles have the same boundary patch name. Then you can get your values as follows:

label patchID = mesh.boundaryMesh().findPatchID("patchName");

const vectorField &bcFaces = mesh.Cf().boundaryField()[patchID]; // Face centres on the circles
const vectorField &bcU = U.boundaryField()[patchID]; // Velocities on the circles
const vectorField &uGrad = U.boundaryField()[patchID].snGrad(); // Normal gradient of the velocity components at the circle

I am not able to help you on the diameter/centre. But I believe you would be able to retrieve such information based on simple geometrical considerations.

Best regards,

Niels

zhoubinwx July 29, 2008 08:32

Hi Niels, Thank you for you
 
Hi Niels,

Thank you for your suggestion, I am working on it and I'll post it here.

Best regards,

Bin

zhoubinwx August 2, 2008 11:30

Hi, in order to know the step
 
Hi, in order to know the step to implement simple boundary condition on models, I use ramped boundary condition, on the base of the boundary "oscillatingFixedValue".

However, when I wmake, I get the error:
Making dependency list for source file icoFoamRamped.C
could not open file rampedFixedValueFVPatchFiedls.H for source file icoFoamRamped.C
make: *** No rule to make target `rampedFixedValueFvPatchFields.dep', needed by `Make/linuxGccDPOpt/dependencies'. Stop.

I do not know how could I solve this problem. Is here anyone who could get me out?

Thank you

zhoubinwx August 7, 2008 04:54

Hi, the above problem is solve
 
Hi, the above problem is solved.

Now when I do as follows:
--------------------------
cp -r $FOAM_TUTORIALS/icoFoam/cavity ~/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped
cd cavityRamped/
cd 0
gedit U &
--------------------------
movingWall
{
type rampedFixValue
refValueLow (0 0 0);
refValueHigh (10 0 0);
startRamp 0.1;
endRamp 0.4;
}
--------------------------
I have changed the movingwall boundary with our modified ramped boundary, then
icoFoamRamped> log &
I get error:
----------------------------
Cannot find 'value' entry on patch movingWall of field U in file "/home/zhou/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped/0/U"
which is required to set the values of the generic patch field.
(Actual type rampedFixValue)

Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so

file: /home/zhou/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped/0/U::moving Wall from line 37 to line 41.

From function genericFvPatchField::genericFvPatchField(const fvPatch&, const Field&, const dictionary&)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.

FOAM exiting
--------------------------

I go deep into the file "rampedFixedValueFvPatchField.C", and could not find anything wrong.

Could I ask for any suggestion about this?

Thank you.

Best regards,

Bin

ngj August 7, 2008 06:14

Hi Zhoubin The way it is do
 
Hi Zhoubin

The way it is done, you need to give an initial value for the patch. Thus you need to add

value uniform (0 0 0);

to you /0/U file in the given patch. This value field should be overwritten in the very first time step.

Of course you can choose any other initial fieldhttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Good luck,

Niels

zhoubinwx August 7, 2008 08:34

Hi Niels, So glad to hear f
 
Hi Niels,

So glad to hear from you again. You are very kind.

I have followed your suggestion, but get the same error.

Therefore I would like to attach the source file here, it is located in the directory: $FOAM_USER_DIR/applications

/attach{icoFoamRamped}

Could I ask you for a look when you are free?

Thank you.

Best regards,

Bin

zhoubinwx August 7, 2008 08:35

The file is:
 
The file is:



zhoubinwx August 7, 2008 08:42

Hi Niels, The maximum of th
 
Hi Niels,

The maximum of the attached file should be 50 kb, therefore I have send the file to your email.

Thank you.

Bin

zhoubinwx August 9, 2008 11:22

Dear all, One friend of mine
 
Dear all,
One friend of mine helps to use a different way to implement the ramped velocity boundary, which will be used for the movingWall patch of cavity case. However, even though it runs ok, when paraFoam is performed, it stops suddenly and says:
----------------------------
--> FOAM Warning :
From function dlLibraryTable::open(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 79
could not load /home/zhou/OpenFOAM/zhou-1.5/lib/linuxGccDPOpt/libmyBCs.so: undefined symbol: _ZTIN4Foam5token8compoundE



Cannot find 'value' entry on patch movingWall of field U in file "/home/zhou/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped/0/U"
which is required to set the values of the generic patch field.
(Actual type rampedFixedValue)

Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so

file: /home/zhou/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped/0/U::moving Wall from line 25 to line 28.

From function genericFvPatchField<type>::genericFvPatchField(con st fvPatch&, const Field<type>&, const dictionary&)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.

FOAM exiting
----------------------------

I need your suggestion if you know how to deal with this.

Many thanks.

Bin

zhoubinwx August 12, 2008 05:16

Dear all, the above problem
 
Dear all,
the above problem is solved with the command "foamToVTK", and use paraFoam to open it.

But now my friend, he tries to simulate and it is so strange that he gets the error when he runs the case cavity:

The error:
Cannot find 'value' entry on patch movingWall of field U in file "/home/zhou/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped/0/U"
which is required to set the values of the generic patch field.
(Actual type rampedFixedValue)

Please add the 'value' entry to the write function of the user-defined boundary-condition
or link the boundary-condition into libfoamUtil.so

file: /home/zhou/OpenFOAM/zhou-1.5/applications/icoFoamRamped/cavityRamped/0/U::moving Wall from line 25 to line 28.

From function genericFvPatchField<type>::genericFvPatchField(con st fvPatch&, const Field<type>&, const dictionary&)
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.
------------------
We need your help.

If anyone knows the reason, would you please tell us.

Thanks a lot.

Best regards,

Bin

zhoubinwx August 12, 2008 05:29

Hi, this is the content of ram
 
Hi, this is the content of rampedFixedValueFvPatchField. C:
-------------------
if (dict.found("value"))
{
fixedValueFvPatchField<type>::operator==
(
Field<type>("value", dict, p.size())
);
}
else
{
fixedValueFvPatchField<type>::operator==
(
refValueLow_ + (refValueHigh_ - refValueLow_)*currentScale()
)
}
______________
this means if we specify a new boundary "rampedFixedValue", the computer will use my equation.

But why I still have the above problems, I am really puzzled.

Bin

ngj August 12, 2008 17:17

Hi Bin I have been wonderin
 
Hi Bin

I have been wondering about one detail. The error message seem to suggest that the actual value on the boundary patch is missing. It should be said that I am still using 1.4.1.

As I suggested above, you should add
value uniform (0 0 0);
in the /0/U file. As you reported this didn't change anything. Though somehow the error message points in that direction and I am wondering that since you have tried and succeeded with this new implementation (your friends), are things in this version actually written to the output files, or does the values at the boundary patch in the <time>/U not change?
If that's the case, there is something wrong in the ::write() in your BC.

I am sorry that I cannot be more specific. Hope you succeed.

Best regards,

Niels

zhoubinwx August 22, 2008 05:57

Hi Niels, The ramped veloci
 
Hi Niels,

The ramped velocity boundary problem is solved when I use "timeVaryingUniformFixedValue".

My purpose to try this simple boundary is to implement our "slip" boundary.

Model studied:in a rectangle, there are three circles(randomly, I set them as a patch "circle"), and the flow is around these circles.

Now let us suppose this kind of partialslip boundary:
Ux(yc - y)^2= partial(Ux)/partial(x)*d
where Ux means the x-component of thpartial(Ux)/partial(x)e velocity U at the circle surface(x,y);
yc means the y-coordinate of the circle center;
d means the circle diamter;

Until now I know that:
(1)x
label patchID = mesh.boundaryMesh().findPatchID("circle");
U.mesh().boundary()[patchID].x()

(2)Xc
use three points-->circle center program,

If I have the id of the patch, you get only the cells around the circle. To find the diameter and center, just loop over the patch and find at least three point mesh.C.
--------------------------------------------
first of all, we need to provide the three points around the circle

label patchID = mesh.boundaryMesh().findPatchID("circle");
volVectorField point1=U.mesh().boundary()[patchID].[0]; ////?????Is this right, I hope this stands for one vertice around the cicle
volVectorField point2=U.mesh().boundary()[patchID].[1];
volVectorField point3=U.mesh().boundary()[patchID].[2]; // three vectors;

-----------------------------------
Next we calculate the center of thoese circles:

#include
#include
#include
using namespace std;

int main()
{
int x1,y1,x3,y3;//x1=point1.x(); y1=point1.y();
double a,b,c,d,e,f;
double r,k1,k2,x,y,x2,y2;
cout<<"please>x1>>y1>>x2>>y2>>x3>>y3;
if((y1==y2)&&(y2==y3))
{
cout<<"The three points can not form a circle!"<circle center program? Be careful the center is not (0,0,0)!!!
);

Info << "Cylinder diameter = " << diameter.value() << " m" << endl;

(4) Ux:
label patchID = mesh.boundaryMesh().findPatchID("circle");
const vectorField &bcU = U.boundaryField()[patchID]; // Velocities on the circles
then
Ux could be expressed by "bcU.component(vector::X)" or "bcU.component(0)";
or "bcU.x()"
(5) partial(Ux)/partial(x) could be expressed by "grad(bcU.component(vector::X)).component(0)".
//suppose scalar could have gradient, like p;

Could you and other friends give me any suggestion to include this boundary?

Many thanks.

Bin

zhoubinwx September 1, 2008 09:07

Dear all, I am thinking abo
 
Dear all,

I am thinking about if I should use the short form or the concise form to define my "slip" boundary.

The concise form is:
U ∙ n = 0
U ∙ t = [Kn/(1+Kn)] n ∙ (U ∙ t)

For the second equation, I write:
----------------------------
label circlePatchID=Mesh().boundary().findPatchID("circl e");
const surfaceVectorField & n=mesh.boundary()[circlePatchID].Cf();
volVectorField U_t=U-n*(n & U); //the tangential component of velocity vector U

solve
(
U_t
==&lambda;/(D+&lambda;)*fvc::snGrad(U_t)
)
----------------------------

Could anyone give me any help for implementing this if the code is right?

Thank you very much.

Bin

ngj September 4, 2008 04:07

Hi Bin Been hung up at work
 
Hi Bin

Been hung up at work, but I have some comments:

1) You say, that you name all the circles with the same patch name. If your are not extremely careful, then you will not be able to know which boundary faces belongs to which circles, and the results you get in diameter/centre will be erroneous. Thus I suggest you use three different names.

2) In your previous post I assume n is your normal? The normal is obtained using mesh.boundary()[circlePatchID].Sf() / mesh.boundary()[circlePatchID].magSf();
where the last part divides by the magnitude of the normal vector.

3)I am not complete sure what it is you mean by this partial slip condition, and my browser doesn't like some of your characters, so could you please come up with a sketch?

Best regards,

Niels

zhoubinwx September 4, 2008 10:32

Hi Niels, Glad to hear from
 
Hi Niels,

Glad to hear from you.

1) I name all the circles as a patch "circle". At first I think I use "forAll" to loop. Here I accept your suggestions, i.e. using different names. By the way, dear Niels, I have 100 circles in my rectangle. how should I name them?

2) In the previous post, n is the unit normal vector. As you wrote, "mesh.boundary()[circlePatchID].Sf() / mesh.boundary()[circlePatchID].magSf();" is the unit normal verctor
The meaning of "U ∙ n = 0 " is that the normal velocity around the circle is 0.

3) Sorry for the characters, would you please check the programmersGuide section 2.1.1, the missing character is the gradient.

Since I have derived the equations, would you please help a little bit, to use them instead of the slip/ partial slip condition existing in OpenFOAM.

Best regards,

Bin

zhoubinwx September 8, 2008 04:05

I will investigate this by mys
 
I will investigate this by myself, stop complaining. I will share with you the code after I finish this part. You could email me if you want: zhoubinwx at hotmail.com

zhoubinwx September 11, 2008 03:32

Dear all, For the first que
 
Dear all,

For the first question:
1) I name all the circles as a patch "circle". At first I think I use "forAll" to loop. Here I accept your suggestions, i.e. using different names. By the way, dear Niels, I have 100 circles in my rectangle. how should I name them?

I have solved using Gmsh.

I am working on the second and third problems I have.

ngj September 12, 2008 08:39

Hi Bin I have made a small
 
Hi Bin

I have made a small quick solution, which just require of you to copy-paste into your /0/U file.

### FROM HERE ------------------------

#!/bin/sh
s=1

while [ $s -lt 100 ]
do
printf " circle%s\n" $s
printf " {\n"
printf "\ttype\tslip;\n"
printf " }\n\n"
s="$(expr "$s" '+' '1')"
done

### TO HERE --------------------------

Put is in a empty file and execute it as

sh <filename> > tempToPasteTo_0_U

Have a nice weekend

zhoubinwx September 12, 2008 10:21

Hi Niels, http://www.cfd-on
 
Hi Niels,

http://www.cfd-online.com/OpenFOAM_D...part/happy.gifhttp://www.cfd-online.com/OpenFOAM_D...part/happy.gifhttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

You see how stupid I am, as you suggested, we could use a simple code to do this work if the syntax is not available for this repeat problem.

Have a nice weekend.

By the way, please allow me to send my best wished to you, your family and all Foamers here. Because on Sep 14, it is Mid-autum day, which means the family get-together and have fun.

Best regards,

Bin

zhoubinwx September 17, 2008 06:12

Dear Niels and all friends her
 
Dear Niels and all friends here,

I am glad to tell you that I find great pleasure writing my own code now, it is near completed.

Now pls allow me to ask a question:

Briefly: How to get three points on the boundary?

Detailed:The way to provide the three points around the circle below is right?

label patchID = mesh.boundaryMesh().findPatchID("circle");
volVectorField point1=U.mesh().boundary()[patchID].[0];
volVectorField point2=U.mesh().boundary()[patchID].[1];
volVectorField point3=U.mesh().boundary()[patchID].[2];

I need your hint at his point.

Best regards,
Bin

zhoubinwx September 17, 2008 12:10

Dear all, I know it is not
 
Dear all,

I know it is not good to ask so many questions. I have followed one principle "problem is important when we compile".

Now please allow me to ask one more questions (till now the above question is unsolved). I am thinking...

abelAs you could see:
If I want to use "mesh.boundary()[circlePatchID].Sf() / mesh.boundary()[circlePatchID].magSf();", I must do:
circlePatchID=Mesh().boundary().findPatchID("circl e1");

But I have 100 circles.

What I am thinking is that: if I specify whatever circles I have ( circle1, circle2, ...), as long as I specify "circleSlip", they will use my own boundary.

I am doing this, I hope I could find a way out this evening.Otherwise I will be sleepless.

Good luck to me.

Best regards,

bin

ngj September 17, 2008 13:03

Hi Bin Glad to hear that yo
 
Hi Bin

Glad to hear that you are having progress.

@First post:

I would do something like this, say circle1:

label patchID = mesh.boundaryMesh().findPatchID("circle1");
const vectorField & pp = mesh.boundary()[patchID].Cf();
if (pp.size() >= 3)
{
vector p0 = pp[0];
vector p1 = pp[1];
vector p2 = pp[2];
}

I have had a bad experience with the way you mentioned, as it not always points to the correct value in the memory, but returns random values, therefore the seperate vectorField for the boundary field.

@second question

Still I assume that you are coding this directly in the solver? So what if you where doing something like this:

forAll(mesh.boundary(),patchID)
{
if(mesh.boundary()[patchID].type() == "circleSlip")
{
Do your magic...
}
}

I am doing this away from a working OF, but it should work, as far as I recall.

On the other hand, if you have made a boundary-object, then if does know which patch you are dealing with, and thus it knows exactly which points are on the present patch, i.e. circle1, circle2, etc.

Good luckhttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Niels

zhoubinwx September 18, 2008 06:05

Hi Niels, You are so kind,
 
Hi Niels,

You are so kind, and what you said is valuable for me.

I do this one step by one step, I hope I could deserve my carefulness.

When I compile, I get:
circleSlipFvPatchVectorField.C:156: error: 'grad' was not declared in this scope

This error points to:
//gradient of the above "tangential component";
vectorField GradTan= grad(phi_t);

As you could see the above equation, after I get the tangential velocity phi_t, I should perform the gradient on it.

I search the Doxgen online help, only to find that gradient is used for boundary normal gradient (without any input parameters).

From the programmerGuide.pdf P-37, I know that we have many ways i.e. grad(chi), gGrad(phi), lsGrad(phi), snGrad(phi),snGradCorrection(phi),
for vectorField, chi and phi are both ok.

This is the reason why I have the above mentioned code.

Hope you and any other friends could understand my situation now.

Well, I benefit a lot from your suggestions and by the way from the error during compiling.

Best regards,

Bin

zhoubinwx September 18, 2008 10:06

Hello, Can I show my think
 
Hello,

Can I show my thinking:

1. is it possible to use the one as the solver in the boundary condition, but not solver. Like:
-------------------------
fvVectorMatrix UEqn
(
n*fvc::grad(phi_t)
);

solve(UEqn == (remda_+diam)/remda_*phi_t);
-------------------------

2. If there is no such function as "supposed" grad(phi_t), after I define "phi_t=phi_-n*(n & phi_)"

I am struggling about this.

Gook luck to me.

Best regards,

bin

zhoubinwx September 18, 2008 10:07

Sorry, the 2 method is to defi
 
Sorry, the 2 method is to define a self gradient for this parameter, let me work on it....

zhoubinwx September 18, 2008 10:54

Dear all, I could see that
 
Dear all,

I could see that fvm::grad(phi) could be used in the solver/applications.

Therefore can I build a file named "tanUGrad.H"
-------------------------
fvPatchTensorField tanUGrad

(

IOobject

(

"tanUGrad",

runTime.timeName(),

mesh,

IOobject::NO_READ

),

fvm::grad(U-(patch().Sf()/patch().magSf())*((patch().Sf()/patch().magSf()) & U))

);

tanUGrad.write();
-------------------------

Then #include "tanUGrad.H" in the solver when we want to use this boundary condition, so as to write the data "tanUGrad" in each time directory.

Although this will generate the gradient of the previous, they are used for the current boundary calculation. This may generate error during the simulation.

This is my stupid thinking.

Welcome your comments for my current gradient function problem.

Best regards,

Bin

zhoubinwx September 19, 2008 06:06

Dear all, I find the functi
 
Dear all,

I find the function of snGrad ()
----------------------------------
//- Return gradient at boundary
tmp<vectorfield> circleSlipFvPatchVectorField::snGrad() const
{
vectorField nHat=patch().nf();
vectorField pif_=this->patchInternalField();

return
(
transform(I - sqr(nHat),pif_)-pif_
)*patch().deltaCoeffs();
}
-------------------------------

First of all, I do not fully understand "transform(I - sqr(nHat),pif_)";

Second, after I look at the function transform(), I find what is written upbove is not right (because this function only needs one parameter input, maybe I am "wrong", welcome help);

Third, one option to replace "transform(I - sqr(nHat),pif_)-pif_ " maybe "*this - patchInternalField()";

Ok, since as we could see snGrad () returns gradient at boundary. In my boundary condition "circleSlip", we can get the grad(U) only with snGrad().

But in the expression, we also know the vector "tangential velocity": tanU=U-n*(n & U). I really do not know how could I get grad(tanU) on the boundary using snGrad(). (It should return any gradient at boundary)

Welcome suggestions for the syntax.

Thank you.

Best regards,

Bin

zhoubinwx September 19, 2008 13:06

Hello, I find one "possible
 
Hello,

I find one "possible" way to define a member function for the gradient of tangential velocity: grad(u_tangential), but still I need your suggestions if possible.

In the .H file
--------------------
virtual tmp<vectorfield> tanUGrad() const;
--------------------

In the .C file
--------------------
tmp<vectorfield> circleSlipFvPatchVectorField::tanUGrad() const
{
vectorField nHat=patch().nf(); iPt=this->patchInternalField()-n*(n & this->patchInternalField());
vectorField bPt=(*this)-n*(n & (*this));
vectorField iPt=(this->patchInternalField())-n*(n & (this->patchInternalField()));

return
(
bPt - iPt
)*patch().deltaCoeffs();
}
--------------------

However, it seems strange to me that when I compile, I get:
--------------------
circleSlipFvPatchVectorField.C: In member function 'virtual Foam::tmp<foam::field<foam::vector<double> > > Foam::circleSlipFvPatchVectorField::tanUGrad() const':
circleSlipFvPatchVectorField.C:143: error: no match for 'operator&' in '((const Foam::circleSlipFvPatchVectorField*)this)->Foam::circleSlipFvPatchVectorField::n & *(const Foam::circleSlipFvPatchVectorField*)this'
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/wordI.H:146: note: candidates are: Foam::word Foam::operator&(const Foam::word&, const Foam::word&)
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionSet.H:278: note: Foam::dimensionSet Foam::operator&(const Foam::dimensionSet&, const Foam::dimensionSet&)
--------------------

You know what I do next? I think why I could not use the innerProduct function.

I search the Doxgen, and find that this function is defined in "products.H", and In "FieldFieldFunctions.C".

I could not solve this till now, would anybody give me a hint? Many thanks to you.

Best regards,

Bin

zhoubinwx September 19, 2008 16:10

Hi, Let allow me to answer
 
Hi,

Let allow me to answer myself for this problem.

In the .C file, replace "n" with "nHat".

Best regards,

Bin

zhoubinwx September 21, 2008 10:31

Dear all, When I apply my b
 
Dear all,

When I apply my boundary, the simulation suddenly stops. I check the output value, and get:

1. The three point coordinates are (4.41226e-05,5.79779e-05), (4.71079e-05,6.24456e-05), (4.2272e-05,5.92143e-05);
The circle center coordinate ishttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif4.469e-05,6.083e-05)-----this is correct, I have compared with gmsh geo file
The diamter of the circle is:5.81612e-06-----however, the diameter should be 5.93 micrometer (I am sure the equation to calculate diameter is right: 2*sqrt(....)).

Would you mind if I ask how could I improve the accuracy for diameter???

2. Circle surface normal unit vetor is
16
(
(7.63918e-313 1.11173e+171 1.57793e+161)
(2.06999e+161 1.01199e+261 2.31634e-152)
(4.90982e-311 -7.84048e-45 0)
(0.831478 -0.555558 4.60283e-19)
(-0.980786 -0.195085 5.31636e-19)
(0.980786 -0.195085 -5.31636e-19)
(-0.831478 0.555558 -1.15071e-18)
(0.555558 -0.831478 6.88294e-19)
(-0.980786 0.195085 5.59336e-19)
(-0.555558 -0.831478 -1.25939e-18)
(-0.195085 -0.980786 5.31636e-19)
(0.555558 0.831478 -4.60283e-19)
(0.195085 -0.980786 -5.31636e-19)
(-0.195085 0.980786 5.59336e-19)
(0.980786 0.195085 -5.59336e-19)
(-0.555558 0.831478 1.03138e-18)
)

I really do not know why the first three has so large numbers?

Just for your information.

Best regards,

Bin

zhoubinwx September 21, 2008 16:15

Dear all, The second proble
 
Dear all,

The second problem is solved without "reference" to the vectorField n.

Now I have a severe problems, when I run my case with simpleFoam and this boundary condition is implemented.

The set is the same as what I have successfully done using slip, partialSlip boundary existing in OpenFOAM 1.5.

But I find from the output file that: the case just apply "circleSlip" on the first circle, it runs only at time=0, and it writes the same thing repeatedly and seems endless. My log file becomes 58.2 M at the first several runs.

I really do not know why the algorithm just repeat on the first "circle1" patch, and always on the time 0 ???

If you need some more information, I would be glad to share with you.

I would appreciate it if you could give me a hand.

Thank you.

Bin

zhoubinwx September 22, 2008 02:26

Hi, deal all, In order to s
 
Hi, deal all,

In order to solve this problem, I copy the partialSlip directory into name-1.5/application, and change "partial" into "circle", add Make directory, in which we have the "files" and "options":

In "files":
circleSlipFvPatchField.C
LIB = $(FOAM_USER_LIBBIN)/libcircleSlip

In "options":
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS =

When I compile, I get:
-------------------------
Making dependency list for source file circleSlipFvPatchField.C
SOURCE=circleSlipFvPatchField.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/zhou/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/circleSlipFvPatchField.o
circleSlipFvPatchField.C:42: error: redefinition of 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&)'
circleSlipFvPatchField.C:42: error: 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&)' previously declared here
circleSlipFvPatchField.C:56: error: redefinition of 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::circleSlipFvPatchField<type>&, const Foam::fvPatch&, const Foam::DimensionedField<type,>&, const Foam::fvPatchFieldMapper&)'
circleSlipFvPatchField.C:56: error: 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::circleSlipFvPatchField<type>&, const Foam::fvPatch&, const Foam::DimensionedField<type,>&, const Foam::fvPatchFieldMapper&)' previously declared here
circleSlipFvPatchField.C:69: error: redefinition of 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&, const Foam::dictionary&)'
circleSlipFvPatchField.C:69: error: 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&, const Foam::dictionary&)' previously declared here
circleSlipFvPatchField.C:82: error: redefinition of 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::circleSlipFvPatchField<type>&)'
circleSlipFvPatchField.C:82: error: 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::circleSlipFvPatchField<type>&)' previously declared here
circleSlipFvPatchField.C:94: error: redefinition of 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::circleSlipFvPatchField<type>&, const Foam::DimensionedField<type,>&)'
circleSlipFvPatchField.C:94: error: 'Foam::circleSlipFvPatchField<type>::circleSlipFvP atchField(const Foam::circleSlipFvPatchField<type>&, const Foam::DimensionedField<type,>&)' previously declared here
circleSlipFvPatchField.C:107: error: redefinition of 'void Foam::circleSlipFvPatchField<type>::autoMap(const Foam::fvPatchFieldMapper&)'
circleSlipFvPatchField.C:107: error: 'virtual void Foam::circleSlipFvPatchField<type>::autoMap(const Foam::fvPatchFieldMapper&)' previously declared here
circleSlipFvPatchField.C:119: error: redefinition of 'void Foam::circleSlipFvPatchField<type>::rmap(const Foam::fvPatchField<type>&, const Foam::labelList&)'
circleSlipFvPatchField.C:119: error: 'virtual void Foam::circleSlipFvPatchField<type>::rmap(const Foam::fvPatchField<type>&, const Foam::labelList&)' previously declared here
circleSlipFvPatchField.C:131: error: redefinition of 'Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::snGrad() const'
circleSlipFvPatchField.C:131: error: 'virtual Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::snGrad() const' previously declared here
circleSlipFvPatchField.C:144: error: redefinition of 'void Foam::circleSlipFvPatchField<type>::evaluate(Foam: :Pstream::commsTypes)'
circleSlipFvPatchField.C:144: error: 'virtual void Foam::circleSlipFvPatchField<type>::evaluate(Foam: :Pstream::commsTypes)' previously declared here
circleSlipFvPatchField.C:164: error: redefinition of 'Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::snGradTransfor mDiag() const'
circleSlipFvPatchField.C:164: error: 'virtual Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::snGradTransfor mDiag() const' previously declared here
circleSlipFvPatchField.C:181: error: redefinition of 'void Foam::circleSlipFvPatchField<type>::write(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) const'
circleSlipFvPatchField.C:181: error: 'virtual void Foam::circleSlipFvPatchField<type>::write(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) const' previously declared here
make: *** [Make/linuxGccDPOpt/circleSlipFvPatchField.o] Error 1
-----------------------

Does anybody have experience dealing with "redefinition"?

Thank you.

Bin

zhoubinwx September 22, 2008 03:06

Hi, share with you. Solutio
 
Hi, share with you.

Solution:
in Make/files: replace "circleSlipFvPatchField.C" with "circleSlipFvPatchFields.C"

zhoubinwx September 22, 2008 05:56

Dear all, I find it is str
 
Dear all,

I find it is strange, because when I use the existing partialSlip boundary file as a base, I could not use the operator "&" in
vectorField iPt=(this->patchInternalField())-n*(n & (this->patchInternalField()));

I get the error:
------------------------
circleSlipFvPatchField.C: In member function 'Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::tanUGrad() const [with Type = Foam::SymmTensor<double>]':
circleSlipFvPatchFields.C:42: instantiated from here
circleSlipFvPatchField.C:150: error: conversion from 'Foam::tmp<foam::field<foam::tensor<double> > >' to non-scalar type 'Foam::Field<foam::symmtensor<double> >' requested
circleSlipFvPatchField.C: In member function 'Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::tanUGrad() const [with Type = Foam::SphericalTensor<double>]':
circleSlipFvPatchFields.C:42: instantiated from here
circleSlipFvPatchField.C:150: error: conversion from 'Foam::tmp<foam::field<foam::tensor<double> > >' to non-scalar type 'Foam::Field<foam::sphericaltensor<double> >' requested
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/products.H: At global scope:
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/products.H: In instantiation of 'Foam::innerProduct<foam::vector<double>, double>':
circleSlipFvPatchField.C:150: instantiated from 'Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::tanUGrad() const [with Type = double]'
circleSlipFvPatchFields.C:42: instantiated from here
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/products.H:100: error: no type named 'type' in 'class Foam::typeOfRank<double,>'
circleSlipFvPatchField.C: In member function 'Foam::tmp<foam::field<type> > Foam::circleSlipFvPatchField<type>::tanUGrad() const [with Type = double]':
circleSlipFvPatchFields.C:42: instantiated from here
circleSlipFvPatchField.C:150: error: no match for 'operator&' in 'nHat2 & iPt0_'
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/wordI.H:146: note: candidates are: Foam::word Foam::operator&(const Foam::word&, const Foam::word&)
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionSet.H:278: note: Foam::dimensionSet Foam::operator&(const Foam::dimensionSet&, const Foam::dimensionSet&)
/home/zhou/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/quaternionI.H:290: note: Foam::scalar Foam::operator&(const Foam::quaternion&, const Foam::quaternion&)
make: *** [Make/linuxGccDPOpt/circleSlipFvPatchFields.o] Error 1
------------------------

This time I checked very carefully, because I only add
vectorField iPt=(this->patchInternalField())-n*(n & (this->patchInternalField()));
where n is well defined.

Is it because I miss some included files?

Bin

zhoubinwx September 22, 2008 06:02

Here is my code: template
 
Here is my code:

template<class>
tmp<field<type> > circleSlipFvPatchField<type>::tanUGrad() const
{
vectorField nHat2=this->patch().nf();
Field<type> iPt0_=this->patchInternalField();
Field<type> iPt=iPt0_-nHat2*(nHat2 & iPt0_);

return
(
transform(I - sqr(nHat2),iPt)-iPt
)*this->patch().deltaCoeffs();
}

zhoubinwx September 22, 2008 06:21

I have checked the programmerG
 
I have checked the programmerGuide.pdf again, I get:

The inner product of two vectors a and b is commutative and produces a scalar
s = a &bull; b where
s = aibi = a1b1 + a2b2 + a3b3

Inner product in OpenFOAM could be used for rank a, b >= 1(in Math: a &bull; b, in OpenFOAM a & b)

Well, I hope I could find a solution to this soon.

zhoubinwx September 23, 2008 15:52

Dear all, I am glad that I
 
Dear all,

I am glad that I could make my boundary condition work, but only the first step.

I need your help because I have an error:

---------------------------
zhou@ENERGETICSAEROSOL:~/OpenFOAM/zhou-1.5/zhou/media_sep23> simpleFoam > log_circleSlip3 &
[1] 9923
zhou@ENERGETICSAEROSOL:~/OpenFOAM/zhou-1.5/zhou/media_sep23> #0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/home/zhou/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/zhou/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xffffe420]
#3 Foam::tmp<foam::field<foam::vector<double> > > Foam::operator*<foam::vector<double> >(Foam::tmp<foam::field<double> > const&, Foam::tmp<foam::field<foam::vector<double> > > const&) in "/home/zhou/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/simpleFoam"
#4 Foam::fv::gaussConvectionScheme<foam::vector<doubl e> >::fvmDiv(Foam::GeometricField<double,> const&, Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/home/zhou/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libfiniteVolume.so"
#5 Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam::fvm::div<foam::vector<double> >(Foam::GeometricField<double,> const&, Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) in "/home/zhou/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/simpleFoam"
#6 Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam::fvm::div<foam::vector<double> >(Foam::GeometricField<double,> const&, Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>&) in "/home/zhou/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/simpleFoam"
#7 main in "/home/zhou/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/simpleFoam"
#8 __libc_start_main in "/lib/libc.so.6"
#9 Foam::regIOobject::readIfModified() in "/home/zhou/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/simpleFoam"
--------------------

I searched this forum, and I see that I could find one solution, but I get some "nan" values on my output files.

I would appreciative if you could have some comments for this.

Best regards,

Bin

zhoubinwx September 27, 2008 11:35

Dear all, When I run the ca
 
Dear all,

When I run the case with my boundary, I get:

DILUPBiCG: Solving for Ux: solution singularity
DILUPBiCG: Solving for Uy: solution singularity
DICPCG: Solving for p: solution singularity
time step continuity errors : sum local = nan, global = nan, cumulative = nan

After I take a look at lduMatrixTests.C, I know that
bool Foam::lduMatrix::solverPerformance::checkSingulari ty
(
const scalar residual
)
{
if (residual > VSMALL)
{
singular_ = false;
}
else
{
singular_ = true;
}

return singular_;
}

void Foam::lduMatrix::solverPerformance::print() const
{
if (debug)
{
Info<< solverName_ << ": Solving for " << fieldName_;

if (singular())
{
Info<< ": solution singularity" << endl;
}
else
{
Info<< ", Initial residual = " << initialResidual_
<< ", Final residual = " << finalResidual_
<< ", No Iterations " << noIterations_
<< endl;
}
}
}

But I am not sure for my problem, where is the possible cause.

Thank you for your attention.

Best regards,

Bin


All times are GMT -4. The time now is 05:09.