@浪迹天大 老师您好,按照这个方法,我需要更改controlDict中的maxDeltaT。但是会发现文件更新不起作用。
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interFlowVb1; startFrom latestTime; startTime 0; stopAt endTime; endTime 0.3; deltaT 0.00005; writeControl adjustableRunTime; writeInterval 0.05; purgeWrite 0; writeFormat binary; writePrecision 8; writeCompression off; timeFormat general; timePrecision 8; runTimeModifiable yes; adjustTimeStep yes; maxCo 0.5; maxAlphaCo 0.5; maxCapillaryNum 10; // stability criteria is 1 maxDeltaT 2e-5;//controlDict.a; // maxDeltaT 1e-5;//controlDict.b; // maxDeltaT 5e-6;//controlDict.c; functions { fileUpdate1 { type timeActivatedFileUpdate; libs ("libutilityFunctionObjects.so"); writeControl timeStep; writeInterval 1; fileToUpdate "$FOAM_CASE/system/controlDict"; timeVsFile ( (-1 "$FOAM_CASE/system/controlDict.a") (1e-4 "$FOAM_CASE/system/controlDict.b") (2e-4 "$FOAM_CASE/system/controlDict.c") ); } }三个文件只有maxDeltaT有差别,请老师捞捞@李东岳 @浪迹天大
运行后结果提示:
timeActivatedFileUpdate: copying file "~/orifice3Da/system/controlDict.c" to: "~/orifice3Da/system/controlDict" Courant Number mean: 2.0171174e-08 max: 0.3369988 Interface Courant Number mean: 2.978204e-10 max: 0.22052861 Capillary Number: 2.4526254 deltaT = 2e-05 Time = 0.00022文件有更新,并且maxDeltaT也更新为了1e-5; 但是它没有发挥作用,可以看到文件更新后的deltaT 依然是 2e-05,如果是我自己运行过程中手动改小maxDeltaT,它会马上从deltaT = 2e-05,便为deltaT = 1e-05。