diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 8e18dc7861..36bccb3911 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -518,11 +518,28 @@ bool Foam::Time::loop() if (running) { - operator++(); + if (!subCycling_) + { + readModifiedObjects(); + + if (timeIndex_ == startTimeIndex_) + { + functionObjects_.start(); + } + else + { + functionObjects_.execute(); + } + } // Check update the "running" status following the "++" operation // to take into account possible side-effects from functionObjects running = run(); + + if (running) + { + operator++(); + } } return running; @@ -667,20 +684,6 @@ Foam::Time& Foam::Time::operator+=(const scalar deltaT) Foam::Time& Foam::Time::operator++() { - if (!subCycling_) - { - readModifiedObjects(); - - if (timeIndex_ == startTimeIndex_) - { - functionObjects_.start(); - } - else - { - functionObjects_.execute(); - } - } - deltaT0_ = deltaTSave_; deltaTSave_ = deltaT_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index fdf6ff0e4f..8c78868648 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -39,6 +39,7 @@ Foam::SurfaceFilmModel::SurfaceFilmModel(CloudType& owner) owner_(owner), g_(dimensionedVector("zero", dimAcceleration, vector::zero)), coeffDict_(dictionary::null), + active_(false), injectorCellsPatch_(0), massParcelPatch_(0), diameterParcelPatch_(0), @@ -62,6 +63,7 @@ Foam::SurfaceFilmModel::SurfaceFilmModel owner_(owner), g_(g), coeffDict_(dict.subDict(type + "Coeffs")), + active_(true), injectorCellsPatch_(0), massParcelPatch_(0), diameterParcelPatch_(0), @@ -85,6 +87,11 @@ template template void Foam::SurfaceFilmModel::inject(TrackData& td) { + if (!active_) + { + return; + } + // Retrieve the film model from the owner database const surfaceFilmModels::surfaceFilmModel& filmModel = this->owner().db().objectRegistry::lookupObject diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index 145b1f421f..41d01f0eee 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -79,6 +79,9 @@ protected: //- The coefficients dictionary const dictionary coeffDict_; + //- Active flag + bool active_; + // Cached injector fields per film patch diff --git a/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary index 3c2a064fff..7407d3a47d 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary +++ b/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary @@ -21,433 +21,433 @@ FoamFile { type patch; nFaces 320; - startFace 1016673; + startFace 955219; } inlet { type patch; nFaces 64; - startFace 1016993; + startFace 955539; } outlet { type patch; nFaces 64; - startFace 1017057; + startFace 955603; } lowerWall { type wall; nFaces 5330; - startFace 1017121; + startFace 955667; } upperWall { type patch; nFaces 160; - startFace 1022451; + startFace 960997; } motorBike_frt-fairing:001%1 { type wall; - nFaces 6626; - startFace 1022611; + nFaces 6595; + startFace 961157; } motorBike_windshield:002%2 { type wall; nFaces 50; - startFace 1029237; + startFace 967752; } motorBike_rr-wh-rim:005%5 { type wall; - nFaces 181; - startFace 1029287; + nFaces 178; + startFace 967802; } motorBike_rr-wh-rim:010%10 { type wall; nFaces 340; - startFace 1029468; + startFace 967980; } motorBike_fr-wh-rim:011%11 { type wall; nFaces 474; - startFace 1029808; + startFace 968320; } motorBike_fr-wh-brake-disk:012%12 { type wall; nFaces 54; - startFace 1030282; + startFace 968794; } motorBike_frame:016-shadow%13 { type wall; - nFaces 131; - startFace 1030336; + nFaces 128; + startFace 968848; } motorBike_rear-susp:014%14 { type wall; - nFaces 1073; - startFace 1030467; + nFaces 1080; + startFace 968976; } motorBike_rear-susp:014-shadow%15 { type wall; - nFaces 159; - startFace 1031540; + nFaces 149; + startFace 970056; } motorBike_frame:016%16 { type wall; - nFaces 20; - startFace 1031699; + nFaces 30; + startFace 970205; } motorBike_rr-wh-rim:005-shadow%17 { type wall; - nFaces 25; - startFace 1031719; + nFaces 27; + startFace 970235; } motorBike_rr-wh-chain-hub:022%22 { type wall; nFaces 141; - startFace 1031744; + startFace 970262; } motorBike_rearseat%24 { type wall; nFaces 432; - startFace 1031885; + startFace 970403; } motorBike_frt-fairing%25 { type wall; nFaces 626; - startFace 1032317; + startFace 970835; } motorBike_windshield%26 { type wall; - nFaces 428; - startFace 1032943; + nFaces 432; + startFace 971461; } motorBike_headlights%27 { type wall; nFaces 161; - startFace 1033371; + startFace 971893; } motorBike_driversseat%28 { type wall; nFaces 367; - startFace 1033532; + startFace 972054; } motorBike_rear-body%29 { type wall; nFaces 2076; - startFace 1033899; + startFace 972421; } motorBike_fuel-tank%30 { type wall; nFaces 912; - startFace 1035975; + startFace 974497; } motorBike_exhaust%31 { type wall; - nFaces 2391; - startFace 1036887; + nFaces 2390; + startFace 975409; } motorBike_rr-wh-rim%32 { type wall; nFaces 1430; - startFace 1039278; + startFace 977799; } motorBike_fr-mud-guard%33 { type wall; - nFaces 767; - startFace 1040708; + nFaces 758; + startFace 979229; } motorBike_fr-wh-rim%34 { type wall; - nFaces 592; - startFace 1041475; + nFaces 591; + startFace 979987; } motorBike_fr-wh-brake-disk%35 { type wall; - nFaces 533; - startFace 1042067; + nFaces 534; + startFace 980578; } motorBike_fr-brake-caliper%36 { type wall; nFaces 164; - startFace 1042600; + startFace 981112; } motorBike_fr-wh-tyre%37 { type wall; - nFaces 1118; - startFace 1042764; + nFaces 1116; + startFace 981276; } motorBike_hbars%38 { type wall; nFaces 535; - startFace 1043882; + startFace 982392; } motorBike_fr-forks%39 { type wall; - nFaces 1144; - startFace 1044417; + nFaces 1143; + startFace 982927; } motorBike_chain%40 { type wall; nFaces 474; - startFace 1045561; + startFace 984070; } motorBike_rr-wh-tyre%41 { type wall; - nFaces 1785; - startFace 1046035; + nFaces 1786; + startFace 984544; } motorBike_square-dial%42 { type wall; nFaces 6; - startFace 1047820; + startFace 986330; } motorBike_round-dial%43 { type wall; - nFaces 18; - startFace 1047826; + nFaces 17; + startFace 986336; } motorBike_dial-holder%44 { type wall; nFaces 87; - startFace 1047844; + startFace 986353; } motorBike_rear-susp%45 { type wall; - nFaces 1787; - startFace 1047931; + nFaces 1786; + startFace 986440; } motorBike_rear-brake-lights%46 { type wall; nFaces 54; - startFace 1049718; + startFace 988226; } motorBike_rear-light-bracket%47 { type wall; nFaces 163; - startFace 1049772; + startFace 988280; } motorBike_frame%48 { type wall; nFaces 2040; - startFace 1049935; + startFace 988443; } motorBike_rear-mud-guard%49 { type wall; - nFaces 804; - startFace 1051975; + nFaces 798; + startFace 990483; } motorBike_rear-susp-spring-damp%50 { type wall; - nFaces 125; - startFace 1052779; + nFaces 124; + startFace 991281; } motorBike_fairing-inner-plate%51 { type wall; nFaces 446; - startFace 1052904; + startFace 991405; } motorBike_clutch-housing%52 { type wall; - nFaces 966; - startFace 1053350; + nFaces 964; + startFace 991851; } motorBike_radiator%53 { type wall; - nFaces 48; - startFace 1054316; + nFaces 58; + startFace 992815; } motorBike_water-pipe%54 { type wall; nFaces 103; - startFace 1054364; + startFace 992873; } motorBike_water-pump%55 { type wall; nFaces 74; - startFace 1054467; + startFace 992976; } motorBike_engine%56 { type wall; - nFaces 2384; - startFace 1054541; + nFaces 2389; + startFace 993050; } motorBike_rear-shock-link%57 { type wall; - nFaces 29; - startFace 1056925; + nFaces 28; + startFace 995439; } motorBike_rear-brake-fluid-pot-bracket%58 { type wall; nFaces 59; - startFace 1056954; + startFace 995467; } motorBike_rear-brake-fluid-pot%59 { type wall; nFaces 53; - startFace 1057013; + startFace 995526; } motorBike_footpeg%60 { type wall; nFaces 87; - startFace 1057066; + startFace 995579; } motorBike_rr-wh-chain-hub%61 { type wall; - nFaces 145; - startFace 1057153; + nFaces 143; + startFace 995666; } motorBike_rear-brake-caliper%62 { type wall; nFaces 142; - startFace 1057298; + startFace 995809; } motorBike_rider-helmet%65 { type wall; nFaces 583; - startFace 1057440; + startFace 995951; } motorBike_rider-visor%66 { type wall; nFaces 95; - startFace 1058023; + startFace 996534; } motorBike_rider-boots%67 { type wall; nFaces 1025; - startFace 1058118; + startFace 996629; } motorBike_rider-gloves%68 { type wall; nFaces 320; - startFace 1059143; + startFace 997654; } motorBike_rider-body%69 { type wall; nFaces 4555; - startFace 1059463; + startFace 997974; } motorBike_frame:0%70 { type wall; nFaces 37; - startFace 1064018; + startFace 1002529; } motorBike_frt-fairing:001-shadow%74 { type wall; - nFaces 1274; - startFace 1064055; + nFaces 1301; + startFace 1002566; } motorBike_windshield-shadow%75 { type wall; - nFaces 101; - startFace 1065329; + nFaces 97; + startFace 1003867; } motorBike_fr-mud-guard-shadow%81 { type wall; - nFaces 129; - startFace 1065430; + nFaces 140; + startFace 1003964; } motorBike_fr-wh-brake-disk-shadow%83 { type wall; - nFaces 77; - startFace 1065559; + nFaces 76; + startFace 1004104; } motorBike_rear-mud-guard-shadow%84 { type wall; - nFaces 138; - startFace 1065636; + nFaces 137; + startFace 1004180; } motorBike_rear-susp-spring-damp-shadow%85 { type wall; nFaces 15; - startFace 1065774; + startFace 1004317; } motorBike_radiator-shadow%86 { type wall; - nFaces 12; - startFace 1065789; + nFaces 4; + startFace 1004332; } motorBike_rear-shock-link-shadow%87 { type wall; - nFaces 7; - startFace 1065801; + nFaces 8; + startFace 1004336; } motorBike_rear-brake-fluid-pot-bracket-shadow%88 { type wall; - nFaces 6; - startFace 1065808; + nFaces 5; + startFace 1004344; } motorBike_rr-wh-chain-hub-shadow%89 { type wall; - nFaces 24; - startFace 1065814; + nFaces 27; + startFace 1004349; } ) diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict index dfa7573fbf..72478f821e 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict @@ -18,13 +18,13 @@ libs ("libincompressibleRASModels.so"); application simpleFoam; -startFrom latestTime; +startFrom startTime; startTime 0; stopAt endTime; -endTime 500; +endTime 1000; deltaT 1; diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes index 7297493347..b83088fb0e 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes @@ -24,7 +24,6 @@ gradSchemes default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; - //grad(U) cellLimited Gauss linear 1; } divSchemes @@ -38,20 +37,17 @@ divSchemes laplacianSchemes { - default Gauss linear corrected; - //default Gauss linear limited 0.5; - //default Gauss linear limited 0.333; + default Gauss linear limited 0.333; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes { - default corrected; + default limited 0.333; } fluxRequired diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict b/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict index d33d4c5131..754eb512a1 100644 --- a/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict +++ b/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict @@ -47,6 +47,21 @@ runTimeModifiable true; functions { + convergenceChecks + { + type residualControl; + functionObjectLibs ( "libresidualControl.so" ); + outputControl timeStep; + outputInterval 1; + + maxResiduals + { + p 1e-2; + U 1e-3; + "(k|epsilon|omega)" 1e-3; + } + } + streamLines { type streamLine; @@ -56,9 +71,9 @@ functions // Output every outputControl outputTime; - //outputInterval 10; + // outputInterval 10; - setFormat vtk;//gnuplot;//xmgr; //raw; //gnuplot; //jplot; + setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; // Velocity field to use for tracking. U U; @@ -70,7 +85,7 @@ functions fields (p k U); // Cells particles can travel before being removed - lifeTime 1000; + lifeTime 1000; // Cloud name to use cloudName particleTracks; @@ -87,24 +102,6 @@ functions end (-0.0205 0.0251 0.00001); nPoints 10; } - -// cloudCoeffs -// { -// type cloud; -// axis x; -// -// points -// ( -// (-0.0205936225239282 0.0144729199524163 0.00001) -// ); -// } - -// triSurfaceMeshPointSetCoeffs -// { -// type triSurfaceMeshPointSet; -// axis distance; -// surface twoTri.stl; -// } } } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index 93d2a24a89..a7c44e8f56 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -103,8 +103,8 @@ ManualInjectionCoeffs { minValue 5e-06; maxValue 0.0005; - d ( 5e-05 ); - n ( 0.5 ); + d 5e-05; + n 0.5; } } } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index 10d1ead7d1..c6c9779b01 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -88,8 +88,8 @@ ManualInjectionCoeffs { minValue 5e-06; maxValue 0.000565; - d ( 4.8e-05 ); - n ( 0.5 ); + d 4.8e-05; + n 0.5; } } } diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties index aff4851a05..5a60774421 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hPsiMixtureThermo>; +thermoType hsPsiMixtureThermo>; chemistryReader foamChemistryReader; diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties index 9e5cf7339a..50a06bdc51 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties @@ -75,8 +75,8 @@ ManualInjectionCoeffs { minValue 5e-05; maxValue 0.0001; - d ( 7.5e-05 ); - n ( 0.5 ); + d 7.5e-05; + n 0.5; } } } diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties index eb85a8803a..ff44ccbd8e 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties @@ -88,8 +88,8 @@ ManualInjectionCoeffs { minValue 5e-06; maxValue 0.0005; - d ( 5e-05 ); - n ( 0.5 ); + d 5e-05; + n 0.5; } } }