Ejemplo n.º 1
0
  private void fixPIMPLE_CENTRALSolver(Model model) {
    State state = model.getState();
    if (state.isTransient() && state.isCompressible() && state.isHighMach()) {
      SystemFolder systemFolder = model.getProject().getSystemFolder();
      if (isCENTRAL() && state.getSolverFamily().isPimple()) {
        state.setSolverFamily(SolverFamily.CENTRAL);
        solversTable.updateSolver(state);
        ModulesUtil.updateSolver(modules, state);

        Dictionary stateData = model.getDefaults().getDefaultsFor(state);
        Dictionary solutionDict = stateData.subDict(SYSTEM).subDict(FV_SOLUTION);
        Dictionary schemesDict = stateData.subDict(SYSTEM).subDict(FV_SCHEMES);

        systemFolder.setFvSolution(solutionDict);
        systemFolder.setFvSchemes(schemesDict);

        model.solverChanged();
      } else if (isPIMPLE() && state.getSolverFamily().isCentral()) {
        state.setSolverFamily(SolverFamily.PIMPLE);
        solversTable.updateSolver(state);
        ModulesUtil.updateSolver(modules, state);

        Dictionary stateData = model.getDefaults().getDefaultsFor(state);
        Dictionary solutionDict = stateData.subDict(SYSTEM).subDict(FV_SOLUTION);
        Dictionary schemesDict = stateData.subDict(SYSTEM).subDict(FV_SCHEMES);

        systemFolder.setFvSolution(solutionDict);
        systemFolder.setFvSchemes(schemesDict);

        model.solverChanged();
      }
    }
  }
Ejemplo n.º 2
0
 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;
 }