Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing initial state values in MPhys #321

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5a36918
Adding info print control when setting the aeroproblem for ADflow and…
lamkina Aug 19, 2023
177c020
Reverting import ordering
lamkina Aug 19, 2023
4fff8c6
Adding surface coordinate fix
lamkina Aug 22, 2023
c580310
Turning on printing in the ADflow solver comp
lamkina Aug 24, 2023
8b68ffc
Merge branch 'main' of github.com:mdolab/adflow into mphys_fix
lamkina Aug 24, 2023
1130ab8
Updated the logic to only print when the aeroproblem actually changes
lamkina Aug 24, 2023
6a17ec4
Updated the logic to only print when the aeroproblem actually changes
lamkina Aug 24, 2023
aff3806
Merge branch 'main' into mphys_fix
lamkina Aug 24, 2023
35962fb
Merge branch 'main' into mphys_fix_2
A-CGray Aug 24, 2023
146eaa9
Merge branch 'main' into mphys_fix
A-CGray Sep 6, 2023
2c4405a
Merge branch 'main' into mphys_fix_2
A-CGray Sep 6, 2023
fed1c61
Merge branch 'main' into mphys_fix_2
A-CGray Sep 11, 2023
63773ca
Merge branch 'main' into mphys_fix
A-CGray Sep 12, 2023
2b74de3
Adding info print control when setting the aeroproblem for ADflow and…
lamkina Aug 19, 2023
22d9783
Reverting import ordering
lamkina Aug 19, 2023
574b184
Adding surface coordinate fix
lamkina Aug 22, 2023
bcce60b
Updated the logic to only print when the aeroproblem actually changes
lamkina Aug 24, 2023
767105f
Merge branch 'mphys_fix_2' of github.com:lamkina/adflow into mphys_fix_2
lamkina Sep 14, 2023
3e750a7
Revert "Updated the logic to only print when the aeroproblem actually…
lamkina Sep 14, 2023
432c7b6
Revert "Adding info print control when setting the aeroproblem for AD…
lamkina Sep 14, 2023
736a62c
Merge branch 'main' of github.com:mdolab/adflow into mphys_fix
lamkina Sep 14, 2023
b529803
Switched from passing arguments to using options and module variables
lamkina Sep 14, 2023
169e69a
Forgot to run black
lamkina Sep 14, 2023
76eae9b
Added extra flag for printing info in setAeroProblem
lamkina Sep 14, 2023
c1ff161
Removed hacky fix for setting initial states in ADflow
lamkina Sep 22, 2023
3f73f1c
Merge branch 'main' of github.com:mdolab/adflow into mphys_fix
lamkina Sep 22, 2023
b8f11da
Re-ran fprettify
lamkina Sep 22, 2023
6edb1db
Removed unnecessary print logic
lamkina Sep 22, 2023
7322d05
Merge branch 'mphys_fix_2' of github.com:lamkina/adflow into mphys_in…
lamkina Sep 22, 2023
483865b
Fixed updatebcdataalllevels calls
lamkina Sep 22, 2023
cbb68d3
Free stream states are working using _set_vectors()
lamkina Sep 22, 2023
d26c838
Need to turn printing back on after setting the AP
lamkina Sep 22, 2023
530ad9e
Merge branch 'mphys_fix' of github.com:lamkina/adflow into mphys_init…
lamkina Sep 22, 2023
267b7b7
Ran black again
lamkina Sep 22, 2023
ed0c6fd
Removing typo
lamkina Sep 26, 2023
947282e
Merge branch 'main' into mphys_init_guess_fix
lamkina Sep 26, 2023
e0b0d5a
Merge branch 'main' into mphys_init_guess_fix
A-CGray Sep 28, 2023
261172d
Merge branch 'main' of github.com:mdolab/adflow into mphys_init_guess…
lamkina Oct 24, 2023
b45bab5
Merge branch 'main' of github.com:mdolab/adflow into mphys_init_guess…
lamkina Nov 4, 2023
4d5ecf6
Merge branch 'main' of github.com:mdolab/adflow into mphys_init_guess…
lamkina Nov 10, 2023
d26295d
Cleaning up missed output printing
lamkina Nov 10, 2023
78b8cc0
Merge branch 'main' into mphys_init_guess_fix
A-CGray Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 27 additions & 1 deletion adflow/mphys/mphys_adflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,28 @@
def _set_states(self, outputs):
self.solver.setStates(outputs["adflow_states"])

def _setup_vectors(self, root_vectors):
super()._setup_vectors(root_vectors)
solver = self.solver

Check warning on line 473 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L471-L473

Added lines #L471 - L473 were not covered by tests

# Get the default flags
printIterationsDefault = solver.getOption("printIterations")
printBCWarningsDefault = solver.adflow.inputiteration.printbcwarnings

Check warning on line 477 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L476-L477

Added lines #L476 - L477 were not covered by tests

# Turn off extra printouts
solver.setOption("printIterations", False)
solver.adflow.inputiteration.printbcwarnings = False

Check warning on line 481 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L480-L481

Added lines #L480 - L481 were not covered by tests

# Set the AP
self.solver.setAeroProblem(self.ap)

Check warning on line 484 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L484

Added line #L484 was not covered by tests

# Set values back to the default
solver.setOption("printIterations", printIterationsDefault)
solver.adflow.inputiteration.printbcwarnings = printBCWarningsDefault

Check warning on line 488 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L487-L488

Added lines #L487 - L488 were not covered by tests

# Set the OM states to be equal to the free stream
self.set_val("adflow_states", self.solver.getStates())

Check warning on line 491 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L491

Added line #L491 was not covered by tests

def apply_nonlinear(self, inputs, outputs, residuals):
solver = self.solver
ap = self.ap
Expand All @@ -481,6 +503,7 @@
print_func_call(self)
solver = self.solver
ap = self.ap

if self._do_solve:
setAeroProblem(solver, ap, self.ap_vars, inputs=inputs, outputs=outputs, print_dict=False)
ap.solveFailed = False # might need to clear this out?
Expand Down Expand Up @@ -1029,8 +1052,11 @@
printIterationsDefault = solver.getOption("printIterations")
printBCWarningsDefault = solver.adflow.inputiteration.printbcwarnings

# Turn off extra printouts
solver.setOption("printIterations", False)
solver.adflow.inputiteration.printbcwarnings = False # Turn off extra printouts
solver.adflow.inputiteration.printbcwarnings = False

Check warning on line 1057 in adflow/mphys/mphys_adflow.py

View check run for this annotation

Codecov / codecov/patch

adflow/mphys/mphys_adflow.py#L1057

Added line #L1057 was not covered by tests

# Set the aeroproblem
solver.setAeroProblem(ap)

# Reset back to true to preserve normal ADflow printout structure
Expand Down