# Slip boundary around circles

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 29, 2008, 06:50 Dear all, My simple 2-D incom #1 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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

 July 29, 2008, 07:17 Hi Bin Suppose that all of #2 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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 __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

 July 29, 2008, 08:32 Hi Niels, Thank you for you #3 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 Hi Niels, Thank you for your suggestion, I am working on it and I'll post it here. Best regards, Bin

 August 2, 2008, 11:30 Hi, in order to know the step #4 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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

 August 7, 2008, 04:54 Hi, the above problem is solve #5 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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

 August 7, 2008, 06:14 Hi Zhoubin The way it is do #6 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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 field Good luck, Niels __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

 August 7, 2008, 08:34 Hi Niels, So glad to hear f #7 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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

 August 7, 2008, 08:35 The file is: #8 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 The file is:

 August 7, 2008, 08:42 Hi Niels, The maximum of th #9 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 Hi Niels, The maximum of the attached file should be 50 kb, therefore I have send the file to your email. Thank you. Bin

 August 9, 2008, 11:22 Dear all, One friend of mine #10 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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::genericFvPatchField(con st fvPatch&, const Field&, 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

 August 12, 2008, 05:16 Dear all, the above problem #11 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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::genericFvPatchField(con st fvPatch&, const Field&, 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

 August 12, 2008, 05:29 Hi, this is the content of ram #12 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 Hi, this is the content of rampedFixedValueFvPatchField. C: ------------------- if (dict.found("value")) { fixedValueFvPatchField::operator== ( Field("value", dict, p.size()) ); } else { fixedValueFvPatchField::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

 August 12, 2008, 17:17 Hi Bin I have been wonderin #13 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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

 August 22, 2008, 05:57 Hi Niels, The ramped veloci #14 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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!"

 September 1, 2008, 09:07 Dear all, I am thinking abo #15 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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 ==λ/(D+λ)*fvc::snGrad(U_t) ) ---------------------------- Could anyone give me any help for implementing this if the code is right? Thank you very much. Bin

 September 4, 2008, 04:07 Hi Bin Been hung up at work #16 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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 __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

 September 4, 2008, 10:32 Hi Niels, Glad to hear from #17 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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

 September 8, 2008, 04:05 I will investigate this by mys #18 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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

 September 11, 2008, 03:32 Dear all, For the first que #19 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Torino, Nanjing/Piemente, China/Italy Posts: 164 Rep Power: 10 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.

 September 12, 2008, 08:39 Hi Bin I have made a small #20 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,759 Rep Power: 29 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 > tempToPasteTo_0_U Have a nice weekend __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Tiago CFX 5 August 20, 2013 22:54 Andore Main CFD Forum 1 February 8, 2008 15:45 gdbaldw OpenFOAM Pre-Processing 37 November 27, 2007 05:30 Shukla Main CFD Forum 3 November 11, 2005 16:02 Rasmus Main CFD Forum 0 June 6, 2002 08:49

All times are GMT -4. The time now is 00:29.