# About initilization and also compiling

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 26, 2004, 08:29 Hi Ali, Where are the 'cou #2 Niklas Nordin (Niklas) Guest   Posts: n/a Hi Ali, Where are the 'couple of questions'?

 October 26, 2004, 09:19 Sorry guys, I don't what's #3 Ali (Ali) Guest   Posts: n/a Sorry guys, I don't what's wrong with the messageboard software or anything else. It deletes some of the lines when I submuit my questions. So, the only thing that worked is that I submit my questions separately (!!), so here they are. Thanks in advance: FIRST QUESTION) About setGammaDamBreak in 'damBreak' case, it's written as this: const vectorField& centres = mesh.C().internalField(); forAll(centres, celli) { if (centres[celli].x() < 0.2 && centres[celli].y() < 0.4) { gamma[celli] = 1.0; } else { gamma[celli] = 0.0; } } What should I do to initialized velocity using this code as well? E.g. initialize u=u0 and v=v0 in the water side (where gamma=1) and 0 in the air side (where gamma=0)?

 October 26, 2004, 09:35 After gamma = 1.0; #4 Mattijs Janssens (Mattijs) Guest   Posts: n/a After gamma[celli] = 1.0; add U[celli] = vector(u0, v0, 0); and similarly for the other case.

 October 26, 2004, 09:43 WHEN I want to use the keyboa #5 Ali (Ali) Guest   Posts: n/a WHEN I want to use the keyboard key for "less than" or "greater than", this forum software eliminates some lines. So something is wrong with this software. So, instead of theses characters, I just type "less than" or ... SECOND QUESTION) For initialization of a circle e.g. a drop the folowing formula does not give a smooth initial gamma field. (if (x(i,j)^2+y(i,j)^2) less than or equal to R^2) then gamma=1 A better initialization for 'gamma' in cases of circular shapes is the following if we program it in fortran: for any (i,j) { // if cell contains air if min[x(i-1,j)^2,x(i,j)^2]+min[y(i,j-1)^2,y(i,j)^2] less than R^2 { goto 10 } else { gamma(i,j)=0 goto 30 } // if cell contains liquid 10 if max[x(i-1,j)^2,x(i,j)^2]+min[y(i,j-1)^2,y(i,j)^2] greater than R^2 { goto 20 } else { gamma(i,j)=1 goto 30 } // if cell contains both liquid and air divide the cell into 25 subcells each having a gamma of 0.04 20 for m=1,5{ for n=1,5{ dx=x(i,j)-x(i-1,j) dy=y(i,j)-y(i,j-1) gamma(i,j)=0 if [x(i-1,j)+(m-0.5)/5*dx]^2 + [y(i,j-1)+(n-0.5)/5*dy]^2 less than R^2 { gamma(i,j)=gamma(i,j)+0.04 } } } 30 loop (i,j) } But the problem is that I couldn't find how to find the expression for x(i-1,j). I appreciate if you just give a hint about it. Also if I want to use min or max functions, do I need to include math headers to this file?

 October 26, 2004, 10:30 But the problem is that I coul #7 Niklas Nordin (Niklas) Guest   Posts: n/a But the problem is that I couldn't find how to find the expression for x(i-1,j). FOAM is a 3D unstructed solver, there's no i,j,k indexing. and this is not valid code 'for any (i,j)' centres is a vectorField and to get the components of a vector c = centres[celli] you use c.x(), c.y() or c.z() and please, pleeeeaaaase, do not use 'goto'. For text formatting issues, please note that some characters have a special meaning. You can read about it under 'Documentation', Formatting. Niklas

 October 26, 2004, 11:18 Hello Ali, about your link #8 Mattijs Janssens (Mattijs) Guest   Posts: n/a Hello Ali, about your linking problem: You cannot seem to find some 'PMPI' functions. These are system functions and part of the IRIX64 installation. They get reference because your compilation includes /usr/include/mpi++.h which it shouldn't. (The port of Foam2.2 you are using was compiled on a system where there was no mpi++.h so we did not have this problem) Check the /usr/include/mpi.h line 1081 to see why mpi++ gets included. You can probably disabling the inclusion of the mpi++.h by specifying some compilation flag ('-DXXX') on the compilation line. Check the online manual section on wmake on how to change compilation options.

 October 26, 2004, 12:31 Hello Ali, the compilation #9 Mattijs Janssens (Mattijs) Guest   Posts: n/a Hello Ali, the compilation flag you need is -DMPI_NO_CPPBIND Add it to EXE_INC in Make/options Mattijs

 October 26, 2004, 13:54 Thanks very much Niklas and M #10 Ali (Ali) Guest   Posts: n/a Thanks very much Niklas and Mattijs for your answers, the first and third problem is fully resloved. About finding neighbors of the cell, I'll dig into the source, hopefully I'll figure out that. I know it's an unstructured code, but I thought there is an 'ijk' system for the special case of structured grid. I knew how funny is it to show a couple of lines of 'goto' fortran commands to C++ professionals, seems you simply hate 'goto' and I'm now getting to understand why ;).

 October 27, 2004, 03:47 To find the neighbours of cel #11 Niklas Nordin (Niklas) Guest   Posts: n/a To find the neighbours of celli you must first find the faces of the cell. const labelList& faces = mesh.cells()[celli]; each face have an 'owner' and 'neighbour', const unallocLabelList& owner = mesh.faceOwner(); const unallocLabelList& neighbour = mesh.faceNeighbour(); so to find out the neighbour-cell for facei you do: label facei = faces[i]; label cellj = neighbour[facei]; and if cellj is not equal to celli then the neigbour is cellj, otherwise it's cellj = owner[facei]; N

 April 7, 2011, 09:36 cyclic neighbors #12 New Member   jj Join Date: Apr 2011 Posts: 1 Rep Power: 0 Hi, I've got a question concerning cyclic boundaries. If I have a face (cf) on a cyclic boundary (say on a 2D hex mesh) how can I find the two cells that are coupled to it. If I issue: mesh.faceOwner()[cf] and mesh.faceNeighbor()[cf], then the owner cell label appears accurate but the neighbor cell label (the one that is supposedly coupled to it via the cyclic BC) is not a valid cell label. The simple mesh was created with BlockMesh and the cyclic boundaries were specified correctly. Could you please address this concern? Regards, Jeff D.R. likes this.

 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 Jaho CFX 3 March 30, 2009 00:58 Vijay FLUENT 0 February 12, 2009 19:23 Alex FLUENT 0 August 10, 2008 21:45 co2 FLUENT 2 January 5, 2004 20:34 Zhang_clement FLUENT 5 February 3, 2002 01:56

All times are GMT -4. The time now is 21:47.

 Contact Us - CFD Online - Privacy Statement - Top