- **OpenFOAM Running, Solving & CFD**
(*https://www.cfd-online.com/Forums/openfoam-solving/*)

- - **TimeVaryingUniformFixedValueFvPathField **
(*https://www.cfd-online.com/Forums/openfoam-solving/59357-timevaryinguniformfixedvaluefvpathfield.html*)

Hi All,
I am using the timeHi All,
I am using the timeVaryingUniformFixedValue class to vary the inlet pressure with respect to time. The data file is ( 0 1.547987616 0.1 1.716125532 0.2 1.880123578 0.3 1.9 0.4 1.98 ) I am using a timestep of 0.1 (this is just a test case, so not worried about the co number!) I have print statements in the interpolateXY.C to check for the values of lo and hi that is computed. Does anyone have an ideas as to why for the time 0.3 it goes to " if (lo<n && hi<n && lo != hi)" loop in the interpolateXY.c though the data table does have a value for time = 0.3? At every other time t it goes to the right loop with is "else if (lo == hi)". Is this a bug? [skabilan@brahma openFoam_Radau]$ icoFoam . weibel_icofoam_trans_modified /*---------------------------------------------------------------------------*\ | ========= | | | \ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \ / O peration | Version: 1.4.1 | | \ / A nd | Web: http://www.openfoam.org | | \/ M anipulation | | \*---------------------------------------------------------------------------*/ Exec : icoFoam . weibel_icofoam_trans_modified Date : Oct 23 2007 Time : 01:33:42 Host : brahma PID : 16382 Root : /home/skabilan/workdir/openfoam/openFoam_Radau Case : weibel_icofoam_trans_modified Nprocs : 1 Create time Create mesh for time = 0 Reading transportProperties Reading field p Loop: else if (lo == hi) hi =0 lo=0 Reading field U Reading/calculating face flux field phi Starting time loop Time = 0.1 Courant Number mean: 0 max: 0 DILUPBiCG: Solving for Ux, Initial residual = 0.999504, Final residual = 0.00809314, No Iterations 6 DILUPBiCG: Solving for Uy, Initial residual = 0.999507, Final residual = 0.00820286, No Iterations 6 DILUPBiCG: Solving for Uz, Initial residual = 0.999504, Final residual = 0.00845304, No Iterations 6 Loop: else if (lo == hi) hi =1 lo=1 GAMG: Solving for p, Initial residual = 1, Final residual = 0.0350794, No Iterations 2 time step continuity errors : sum local = 0.0324785, global = -0.00358765, cumulative = -0.00358765 Loop: else if (lo == hi) hi =1 lo=1 GAMG: Solving for p, Initial residual = 0.260792, Final residual = 0.00856939, No Iterations 2 time step continuity errors : sum local = 0.0138521, global = -0.000358116, cumulative = -0.00394577 ExecutionTime = 30.04 s ClockTime = 33 s Time = 0.2 Courant Number mean: 0.315566 max: 49.5862 DILUPBiCG: Solving for Ux, Initial residual = 0.561483, Final residual = 0.00506271, No Iterations 10 DILUPBiCG: Solving for Uy, Initial residual = 0.763739, Final residual = 0.00641278, No Iterations 10 DILUPBiCG: Solving for Uz, Initial residual = 0.480907, Final residual = 0.00450018, No Iterations 10 Loop: else if (lo == hi) hi =2 lo=2 GAMG: Solving for p, Initial residual = 0.573999, Final residual = 0.0499719, No Iterations 3 time step continuity errors : sum local = 0.113697, global = -0.000186662, cumulative = -0.00413243 Loop: else if (lo == hi) hi =2 lo=2 GAMG: Solving for p, Initial residual = 0.249277, Final residual = 0.017112, No Iterations 2 time step continuity errors : sum local = 0.175116, global = -0.000150884, cumulative = -0.00428331 ExecutionTime = 56.6 s ClockTime = 63 s Time = 0.3 Courant Number mean: 6.81871 max: 178.491 DILUPBiCG: Solving for Ux, Initial residual = 0.571084, Final residual = 2.95901, No Iterations 11 DILUPBiCG: Solving for Uy, Initial residual = 0.499858, Final residual = 0.179136, No Iterations 11 DILUPBiCG: Solving for Uz, Initial residual = 0.562771, Final residual = 0.0983058, No Iterations 11 Loop: if (lo<n && hi<n && lo != hi) hi =4 lo=3 GAMG: Solving for p, Initial residual = 0.6104, Final residual = 0.0294098, No Iterations 5 time step continuity errors : sum local = 0.278484, global = -0.000241645, cumulative = -0.00452496 Loop: if (lo<n && hi<n && lo != hi) hi =4 lo=3 GAMG: Solving for p, Initial residual = 0.229443, Final residual = 0.0170605, No Iterations 2 time step continuity errors : sum local = 2.55355, global = 0.00089873, cumulative = -0.00362623 ExecutionTime = 86.89 s ClockTime = 97 s Time = 0.4 Courant Number mean: 28.7215 max: 536.595 DILUPBiCG: Solving for Ux, Initial residual = 0.687021, Final residual = 0.0960124, No Iterations 11 DILUPBiCG: Solving for Uy, Initial residual = 0.638056, Final residual = 1.99633, No Iterations 11 DILUPBiCG: Solving for Uz, Initial residual = 0.676249, Final residual = 0.573936, No Iterations 11 Loop: else if (lo == hi) hi =4 lo=4 GAMG: Solving for p, Initial residual = 0.731519, Final residual = 0.0346012, No Iterations 4 time step continuity errors : sum local = 3.55919, global = 0.0101174, cumulative = 0.00649117 Loop: else if (lo == hi) hi =4 lo=4 GAMG: Solving for p, Initial residual = 0.236202, Final residual = 0.0173779, No Iterations 2 time step continuity errors : sum local = 16.2332, global = -0.0699737, cumulative = -0.0634826 ExecutionTime = 118.38 s ClockTime = 132 s |

I hope 'hi' and 'lo' are integI hope 'hi' and 'lo' are integers. If they are floating point, then even if 'hi' is equal to 'lo' the C/C++ will not accept it, as 'hi' could be stored as 3.9999999 and 'lo' could be stored as 4.000001 and therefore according to the code, hi != lo. I faced this problem a while ago. See [1].
[1] http://gcc.gnu.org/ml/gcc-help/2005-03/msg00292.html |

Thanks for the explanation!
Thanks for the explanation!
Senthil |

hi and lo are integers (labelshi and lo are integers (labels).
Is there a problem? Does the interpolateXY routine return the wrong answer? |

Hi Mattijs,
I guess there iHi Mattijs,
I guess there is a bit of a problem with the interpolateXY. Though there is an entry (pressure) for the time 0.3 in the data table. The interpolateXY.C is interpolating the values of pressure i.e, goes to "if (lo<n && hi<n && lo != hi) " instead of " else if (lo == hi)" loop because hi and lo are different as can been seen in the output that i have posted. Thanks Senthil |

Hi,
Good day to all! I haveHi,
Good day to all! I have a mesh with eight outlets and every outlet is specified with a timeVaryingUniformFixedValue boundary condition. There are eight data files from which the outlets get their pressure values for every timestep. My question is... in case this problem is solved in parallel, does a single processor read from all the eight datafiles and send the p value to other processors to which the outlet has been alloted by the decomposePar or does the individual processors read the data file directly corresponding to the outlets they handle? I am working on a new boundary condition or patch in OpenFOAM that would allow a 1D system to supply the boundary condition to the 3D system. The answer to the aforementioned question would tremendously help me with my research. Thanks in advance! Senthil |

All times are GMT -4. The time now is 08:04. |