
[Sponsors] 
Inconsistencies in reading .dat file during run time in new injection model 

LinkBack  Thread Tools  Search this Thread  Display Modes 
March 23, 2018, 23:29 
Inconsistencies in reading .dat file during run time in new injection model

#1 
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 10 
Hello everyone!
I'm trying to create a new injection model called myPatchInjection in OpenFOAM. Now, what this model should ideally do is read the time values from a .dat file and if this value matches with the current run time value, inject the corresponding number of particles (read from another column in the .dat file) from a predefined patch. Now, my injection model is reading the values from the .dat file. The problem that I'm facing is that when I compare this value with the actual run time value, it shows some inconsistencies. Here's a small snippet of the output log file that I've generated. Code:
/* Starting time loop Courant Number mean: 2.9067e09 max: 5.5993e06 Time = 1e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 1, Final residual = 9.3372e16, No Iterations 1 GAMG: Solving for Uy, Initial residual = 1, Final residual = 1.231e15, No Iterations 1 GAMG: Solving for Uz, Initial residual = 1, Final residual = 1.4563e15, No Iterations 1 GAMG: Solving for p, Initial residual = 1, Final residual = 0.083761, No Iterations 15 time step continuity errors : sum local = 4.8693e10, global = 8.8325e11, cumulative = 8.8325e11 GAMG: Solving for p, Initial residual = 0.14228, Final residual = 4.2989e05, No Iterations 5 time step continuity errors : sum local = 4.2196e10, global = 4.4371e11, cumulative = 4.3954e11 smoothSolver: Solving for omega, Initial residual = 1.5186e06, Final residual = 1.5186e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 5.4479e06, Final residual = 5.6829e12, No Iterations 1 bounding k, min: 3.3745e11 max: 0.00437 average: 1.1794e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 1e06 1e06 times are = 1e06 1e06 injected!!!1 nParcels = 2 Cloud: kinematicCloud injector: model1 Added 2 new parcels Cloud: kinematicCloud Current number of parcels = 2 Current mass in system = 3.5919e13 Linear momentum = (3.4697e16 8.3259e18 1.0058e17) Linear momentum = 3.4721e16 Linear kinetic energy = 1.8075e19 Injector model1:  parcels added = 2  mass introduced = 3.5919e13 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 12.31 s ClockTime = 13 s Courant Number mean: 4.9714e06 max: 0.00020678 Time = 2e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.85068, Final residual = 9.7623e13, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.33333, Final residual = 2.6761e12, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.33333, Final residual = 2.7184e12, No Iterations 1 GAMG: Solving for p, Initial residual = 0.031994, Final residual = 0.001481, No Iterations 4 time step continuity errors : sum local = 1.7484e08, global = 2.2431e09, cumulative = 2.287e09 GAMG: Solving for p, Initial residual = 0.31987, Final residual = 8.3962e05, No Iterations 11 time step continuity errors : sum local = 3.1866e10, global = 2.8136e11, cumulative = 2.2589e09 smoothSolver: Solving for omega, Initial residual = 1.5038e06, Final residual = 1.5038e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.1665e06, Final residual = 6.8355e12, No Iterations 1 bounding k, min: 9.6714e16 max: 0.00437 average: 1.1794e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 2e06 2e06 times are = 2e06 1e06 times are = 2e06 2e06 injected!!!2 nParcels = 2 Cloud: kinematicCloud injector: model1 Added 2 new parcels Cloud: kinematicCloud Current number of parcels = 4 Current mass in system = 7.1838e13 Linear momentum = (9.0704e16 1.5161e17 2.1691e17) Linear momentum = 9.0743e16 Linear kinetic energy = 6.262e19 Injector model1:  parcels added = 4  mass introduced = 7.1838e13 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 17.71 s ClockTime = 18 s Courant Number mean: 5.082e06 max: 0.00029584 Time = 3e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.058207, Final residual = 5.7874e13, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.079777, Final residual = 7.6951e13, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.079944, Final residual = 7.3876e13, No Iterations 1 GAMG: Solving for p, Initial residual = 0.54321, Final residual = 0.028242, No Iterations 1 time step continuity errors : sum local = 2.151e08, global = 7.774e11, cumulative = 2.3366e09 GAMG: Solving for p, Initial residual = 0.12556, Final residual = 7.9445e05, No Iterations 12 time step continuity errors : sum local = 3.1715e11, global = 4.8023e12, cumulative = 2.3414e09 smoothSolver: Solving for omega, Initial residual = 1.4818e06, Final residual = 1.4818e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.1876e06, Final residual = 6.9469e12, No Iterations 1 bounding k, min: 8.9151e16 max: 0.00437 average: 1.1794e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 3e06 3e06 times are = 3e06 1e06 times are = 3e06 2e06 times are = 3e06 3e06 injected!!!3 nParcels = 2 Cloud: kinematicCloud injector: model1 Added 2 new parcels Cloud: kinematicCloud Current number of parcels = 6 Current mass in system = 1.0776e12 Linear momentum = (1.7001e15 7.2062e18 2.2234e17) Linear momentum = 1.7002e15 Linear kinetic energy = 1.4882e18 Injector model1:  parcels added = 6  mass introduced = 1.0776e12 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 22.87 s ClockTime = 23 s Courant Number mean: 5.0722e06 max: 0.00025577 Time = 4e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.023598, Final residual = 1.4736e13, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.025595, Final residual = 2.1789e13, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.025642, Final residual = 2.1164e13, No Iterations 1 GAMG: Solving for p, Initial residual = 0.22671, Final residual = 0.012459, No Iterations 1 time step continuity errors : sum local = 3.7373e09, global = 1.4419e11, cumulative = 2.327e09 GAMG: Solving for p, Initial residual = 0.037161, Final residual = 5.1962e05, No Iterations 7 time step continuity errors : sum local = 1.2622e11, global = 1.3907e12, cumulative = 2.3284e09 smoothSolver: Solving for omega, Initial residual = 1.4679e06, Final residual = 1.4679e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.1997e06, Final residual = 7.0183e12, No Iterations 1 bounding k, min: 8.2828e16 max: 0.00437 average: 1.1794e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 4e06 4e06 times are = 4e06 1e06 times are = 4e06 2e06 times are = 4e06 3e06 times are = 4e06 4e06 injected!!!4 nParcels = 2 Cloud: kinematicCloud injector: model1 Added 2 new parcels Cloud: kinematicCloud Current number of parcels = 8 Current mass in system = 1.4368e12 Linear momentum = (2.7347e15 1.6502e17 2.4217e17) Linear momentum = 2.7348e15 Linear kinetic energy = 2.9192e18 Injector model1:  parcels added = 8  mass introduced = 1.4368e12 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 27.42 s ClockTime = 28 s Courant Number mean: 5.0666e06 max: 0.00024399 Time = 5e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.014702, Final residual = 7.9554e14, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.014753, Final residual = 1.1438e13, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.014788, Final residual = 1.12e13, No Iterations 1 GAMG: Solving for p, Initial residual = 0.1035, Final residual = 0.0058512, No Iterations 1 time step continuity errors : sum local = 1.1684e09, global = 1.2116e11, cumulative = 2.3163e09 GAMG: Solving for p, Initial residual = 0.015401, Final residual = 5.5016e05, No Iterations 8 time step continuity errors : sum local = 9.8979e12, global = 1.3963e12, cumulative = 2.3149e09 smoothSolver: Solving for omega, Initial residual = 1.4582e06, Final residual = 1.4582e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.2094e06, Final residual = 7.0781e12, No Iterations 1 bounding k, min: 7.6605e16 max: 0.00437 average: 1.1795e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 5e06 5e06 times are = 5e06 1e06 times are = 5e06 2e06 times are = 5e06 3e06 times are = 5e06 4e06 times are = 5e06 5e06 times are = 5e06 6e06 times are = 5e06 7e06 times are = 5e06 8e06 times are = 5e06 9e06 times are = 5e06 1e05 times are = 5e06 1.1e05 times are = 5e06 1.2e05 times are = 5e06 1.3e05 times are = 5e06 1.4e05 times are = 5e06 1.5e05 times are = 5e06 1.6e05 times are = 5e06 1.7e05 times are = 5e06 1.8e05 Cloud: kinematicCloud Current number of parcels = 8 Current mass in system = 1.4368e12 Linear momentum = (3.6177e15 1.9033e17 2.6665e17) Linear momentum = 3.6178e15 Linear kinetic energy = 4.8511e18 Injector model1:  parcels added = 8  mass introduced = 1.4368e12 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 31.97 s ClockTime = 32 s Courant Number mean: 5.0642e06 max: 0.00023854 Time = 6e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.010394, Final residual = 5.9842e14, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.010989, Final residual = 8.252e14, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.011012, Final residual = 8.1308e14, No Iterations 1 GAMG: Solving for p, Initial residual = 0.071461, Final residual = 0.003551, No Iterations 1 time step continuity errors : sum local = 5.5515e10, global = 8.8436e12, cumulative = 2.3061e09 GAMG: Solving for p, Initial residual = 0.0093249, Final residual = 7.7875e05, No Iterations 6 time step continuity errors : sum local = 1.1344e11, global = 1.7405e12, cumulative = 2.3043e09 smoothSolver: Solving for omega, Initial residual = 1.4507e06, Final residual = 1.4507e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.2175e06, Final residual = 7.1293e12, No Iterations 1 bounding k, min: 7.0476e16 max: 0.00437 average: 1.1795e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 6e06 6e06 times are = 6e06 1e06 times are = 6e06 2e06 times are = 6e06 3e06 times are = 6e06 4e06 times are = 6e06 5e06 times are = 6e06 6e06 times are = 6e06 7e06 times are = 6e06 8e06 times are = 6e06 9e06 times are = 6e06 1e05 times are = 6e06 1.1e05 times are = 6e06 1.2e05 times are = 6e06 1.3e05 times are = 6e06 1.4e05 times are = 6e06 1.5e05 times are = 6e06 1.6e05 times are = 6e06 1.7e05 times are = 6e06 1.8e05 Cloud: kinematicCloud Current number of parcels = 8 Current mass in system = 1.4368e12 Linear momentum = (4.496e15 2.1861e17 2.9104e17) Linear momentum = 4.4962e15 Linear kinetic energy = 7.3152e18 Injector model1:  parcels added = 8  mass introduced = 1.4368e12 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 36.36 s ClockTime = 37 s Courant Number mean: 5.0624e06 max: 0.00023519 Time = 7e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.0082604, Final residual = 4.9367e14, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.0090454, Final residual = 6.7029e14, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.009053, Final residual = 6.6453e14, No Iterations 1 GAMG: Solving for p, Initial residual = 0.057484, Final residual = 0.0027532, No Iterations 1 time step continuity errors : sum local = 3.6391e10, global = 6.4179e12, cumulative = 2.2979e09 GAMG: Solving for p, Initial residual = 0.0071272, Final residual = 6.3082e05, No Iterations 6 time step continuity errors : sum local = 7.8532e12, global = 1.2076e12, cumulative = 2.2967e09 smoothSolver: Solving for omega, Initial residual = 1.4446e06, Final residual = 1.4446e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.2244e06, Final residual = 7.1739e12, No Iterations 1 bounding k, min: 6.4428e16 max: 0.00437 average: 1.1795e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 7e06 7e06 times are = 7e06 1e06 times are = 7e06 2e06 times are = 7e06 3e06 times are = 7e06 4e06 times are = 7e06 5e06 times are = 7e06 6e06 times are = 7e06 7e06 times are = 7e06 8e06 times are = 7e06 9e06 times are = 7e06 1e05 times are = 7e06 1.1e05 times are = 7e06 1.2e05 times are = 7e06 1.3e05 times are = 7e06 1.4e05 times are = 7e06 1.5e05 times are = 7e06 1.6e05 times are = 7e06 1.7e05 times are = 7e06 1.8e05 Cloud: kinematicCloud Current number of parcels = 8 Current mass in system = 1.4368e12 Linear momentum = (5.3695e15 2.4933e17 3.1531e17) Linear momentum = 5.3696e15 Linear kinetic energy = 1.0302e17 Injector model1:  parcels added = 8  mass introduced = 1.4368e12 Parcel fate: system (number, mass)  escape = 0, 0 Parcel fate: patch INLET (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch PART_1 (number, mass)  escape = 0, 0  stick = 0, 0 Parcel fate: patch OUTLET (number, mass)  escape = 0, 0  stick = 0, 0 ExecutionTime = 40.65 s ClockTime = 41 s Courant Number mean: 5.0612e06 max: 0.00023283 Time = 8e06 PIMPLE: iteration 1 GAMG: Solving for Ux, Initial residual = 0.0067451, Final residual = 4.2145e14, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.0077274, Final residual = 5.6852e14, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.0077286, Final residual = 5.6416e14, No Iterations 1 GAMG: Solving for p, Initial residual = 0.049348, Final residual = 0.0022907, No Iterations 1 time step continuity errors : sum local = 2.6274e10, global = 3.8918e12, cumulative = 2.2928e09 GAMG: Solving for p, Initial residual = 0.0058192, Final residual = 9.2686e05, No Iterations 4 time step continuity errors : sum local = 1.0111e11, global = 1.5107e12, cumulative = 2.2913e09 smoothSolver: Solving for omega, Initial residual = 1.4396e06, Final residual = 1.4396e06, No Iterations 0 smoothSolver: Solving for k, Initial residual = 6.2304e06, Final residual = 7.2135e12, No Iterations 1 bounding k, min: 7.831e12 max: 0.00437 average: 1.1796e06 Evolving kinematicCloud Solving 3D cloud kinematicCloud inj_time: 8e06 8e06 times are = 8e06 1e06 times are = 8e06 2e06 times are = 8e06 3e06 times are = 8e06 4e06 times are = 8e06 5e06 times are = 8e06 6e06 times are = 8e06 7e06 times are = 8e06 8e06 injected!!!8 nParcels = 2 I think the problem lies in the if statement where I'm comparing the times. Possibly, it can also be a case of data type mismatch. This is proving a real roadblock in the work that I'm doing currently. Maybe, its an OpenFOAM bug. I don't know.. The testing.zip file contains the kinematic cloud properties file, the system folder and constant directory. It however does not contain the polyMesh folder or the .msh file due to size constraints that limits the size of the zip file. A simple mesh with boundary zones including INLET, OUTLET and PART_1 can be created to match the zone names that I had while running the case so that no changes to other files would be required. If you choose to run your own mesh, then please change the part names in all the files in the zero folder. Any help is greatly appreciated. The model has been compiled on OpenFOAM v1706. There are slight changes in the header files that need to be made if you're using OF 3.0 or earlier. 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Custom Thermophysical Properties  wsmith02  OpenFOAM  4  June 1, 2023 15:30 
polynomial BC  srv537  OpenFOAM PreProcessing  4  December 3, 2016 10:07 
[Other] Adding solvers from DensityBasedTurbo to foamextend 3.0  Seroga  OpenFOAM Community Contributions  9  June 12, 2015 18:18 
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12  keepfit  ParaView  60  September 18, 2013 04:23 
ParaView Compilation  jakaranda  OpenFOAM Installation  3  October 27, 2008 12:46 