|
[Sponsors] |
problem specifying alpha at inlet during a parallel run |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 12, 2009, 20:35 |
problem specifying alpha at inlet during a parallel run
|
#1 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18 |
Dear OpenFOAM experts:
I want to specify alpha field at the inlet as a function of time. The following piece of code worked fine when running in a serial case. It also run fine when the inlet is NOT partitioned into different processors. However, got alpha 0() if the inlet is partitioned to different processors. It will be appreciated if someone can shed some light on how to fix this problem: Thanks! Pei ---- code: label tIndex = label(runTime.value()/tPeriod); scalar localTime = runTime.value() - tIndex*tPeriod; // Get index of patch label inletPatchID = mesh.boundaryMesh().findPatchID("inlet"); // Get reference to boundary value vectorField& inletU = U.boundaryField()[inletPatchID]; // Manipulate value if(localTime >= 0 && localTime < time1) { velInlet = Wmx*localTime/time1; } else if(localTime < time6) { velInlet = Wmx; } else if(localTime < time7) { scalar tempTime = localTime - time6; velInlet = Wmx*(1.0 - (tempTime/(time7 - time6))); } else if(localTime < tPeriod) { velInlet = 0.0; } inletU = vector(velInlet, 0, 0); Info<< "inletU:" << velInlet << endl; scalarField& inletAlpha = alpha1.boundaryField()[inletPatchID]; if(localTime >= 0 && localTime < time3) { inletAlpha = 1; } else if(localTime < tPeriod) { inletAlpha = 0.0; } Info<< "inlet alpha = " << inletAlpha << endl; |
|
August 13, 2009, 05:15 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
On the other hand: why don't you use the timeVaryingUniform-boundaryCondition for that? Or groovyBC? Hardcoding boundary conditions into solver code is soooo Fortran Bernhard |
||
August 13, 2009, 09:23 |
|
#3 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18 |
Thanks Bernhard!
Yes, this should have been done using timeVaryingUniformFvPatch BC - still learning how to do what I want using this derived BC. According to Mattijs, Info prints out the info on the priminary processor. In my case, the inlet faces happen to be not on the priminary processor, hence, 0(). I have changed from Info to Pout, and now, it writes out the correct information and the code was correct. Pei |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Script to Run Parallel Jobs in Rocks Cluster | asaha | OpenFOAM Running, Solving & CFD | 12 | July 4, 2012 23:51 |
2D Low Speed Airfoil Problem when altering Inlet | mike wilson | CFX | 12 | August 3, 2010 12:06 |
Parallel moving mesh problem | lr103476 | OpenFOAM Running, Solving & CFD | 29 | November 26, 2008 02:55 |
parallel problem | rui | Siemens | 2 | July 31, 2007 14:23 |
PROBLEM IN PARALLEL PROGRAMMING WITH MPI | Niavarani | Main CFD Forum | 1 | April 20, 2004 07:51 |