private void fixPIMPLE_PISOSolver(Model model) { State state = model.getState(); if (state.isTransient() && state.isIncompressible()) { SystemFolder systemFolder = model.getProject().getSystemFolder(); Dictionary fvSolution = systemFolder.getFvSolution(); Dictionary stateData = model.getDefaults().getDefaultStateData(); Dictionary pisoSolution = stateData.subDict("pisoFoamRAS").subDict(SYSTEM).subDict(FV_SOLUTION); Dictionary pimpleSolution = stateData.subDict("pimpleFoamRAS").subDict(SYSTEM).subDict(FV_SOLUTION); if (isPISO() && fvSolution.found(SolverFamily.PIMPLE.getKey())) { systemFolder.setFvSolution(pisoSolution); state.setSolverFamily(SolverFamily.PISO); solversTable.updateSolver(state); ModulesUtil.updateSolver(modules, state); model.solverChanged(); } else if (isPIMPLE() && fvSolution.found(SolverFamily.PISO.getKey())) { systemFolder.setFvSolution(pimpleSolution); state.setSolverFamily(SolverFamily.PIMPLE); solversTable.updateSolver(state); ModulesUtil.updateSolver(modules, state); model.solverChanged(); } } }
private boolean stateHasChanged() { State state = model.getState(); SolverFamily family = state.getSolverFamily(); if (state.isTransient() && state.isIncompressible()) { return family.isPiso() && isPIMPLE() || family.isPimple() && isPISO(); } if (state.isTransient() && state.isCompressible() && state.isHighMach()) { return family.isCentral() && isPIMPLE() || family.isPimple() && isCENTRAL(); } return false; }