CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Problem in a parallel loop.

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

LinkBack Thread Tools Display Modes
Old   March 22, 2012, 10:49
Default Problem in a parallel loop.
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 10
Alucard is on a distinguished road
Goodmorning i'm trying to run in parallel a code I've developed.
Almost everything works fine except this part (attached below) thatit doesn't works.
vtip is small function I've implemented by myself but it's not important right now.
Can someone please tell me what it's wrong with it?
What I do it's to start for a point P that satisfies the condition 0.01<alpha1<0.99 (alpha is 1 in one region of the domain ,0 in the other and varies as an hyperbolic tangent at the interface) and in a way I calulate 2 new points Pint et Pext that are located at alpha1=0.99 and 0.5 respectively and I calculate the two corresponding values of Cl Clext et Clint.
he problem (I think) is that when i run it in parallel the points Pint et Pext doesnt' necessary belong to the same subdomain of P.
Infact i also have a problem in running in in parallel cause it seems it doesn't like the interpolation step (i tried so to use a taylor series to calculate the Cl values as:
C=C(P)+grad(C)*deltax where deltax it's the difference vector between Pint (ou Pext) and the center of the cell Pint?Pext belong to.

Thank you in advance
HTML Code:
///////INTERPOLATION STEP///////////////

dictionary interpolationDict = mesh.solutionDict().subDict("interpolationSchemes");
autoPtr<interpolation<scalar> > ClInterpolator = interpolation<scalar>::New(interpolationDict, C_liq);


forAll (mesh.cellCentres(),cellI)
    if(alpha1[cellI]<=0.99 && alpha1[cellI]>=0.01)  

         vector p = mesh.cellCentres()[cellI];
         vector N = -nHat[cellI];
         double delta_plus;
         double delta_minus;
         double delta_tot;
         double coordinate=W.value()*Foam::log((1.-alpha1[cellI])/alpha1[cellI]);


         vector Pext = p + delta_plus*N;
         vector Pint = p - delta_minus*N; 

         vector pos_int(Pint.x(),Pint.y(),Pint.z());
         vector pos_ext(Pext.x(),Pext.y(),Pext.z()); 

         label cellJ = mesh.findCell(pos_int);
         label cellK = mesh.findCell(pos_ext);

         scalar Clint = ClInterpolator->interpolate(pos_int, cellJ);
         scalar Clext = ClInterpolator->interpolate(pos_ext, cellK);
         scalar deltaCl=(Clint-Clext)/(Clint*(1.-kp0.value())); 

       Omega[cellI]=vtip(deltaCl, kp0.value(), 2.4e-07, liqSlope.value(),20.,20.e-06, D_liq.value());

Alucard is offline   Reply With Quote


Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in the CFX12.1 parallel computation BalanceChen ANSYS 2 July 7, 2011 10:26
Parallel UDF problem, hello world version pilou FLUENT 0 March 10, 2011 09:20
problem to make a UDF parallel pilou Fluent UDF and Scheme Programming 0 March 9, 2011 07:35
problem using property udfs in parallel mode EllenW Fluent UDF and Scheme Programming 5 July 10, 2009 04:31
parallel problem rui Siemens 2 July 31, 2007 13:23

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