Skip to content

Commit

Permalink
update manoeuvre loads
Browse files Browse the repository at this point in the history
  • Loading branch information
ACea15 committed Oct 17, 2024
1 parent eeb928a commit 242b111
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 38 deletions.
49 changes: 17 additions & 32 deletions examples/BUG/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,36 @@
)

inp.fem.folder = pathlib.Path('./FEM/')
inp.fem.eig_names = ["eigenvals_50.npy", "eigenvecs_50.npy"]
inp.fem.num_modes = 50
inp.driver.typeof = "intrinsic"

#inp.driver.sol_path = pathlib.Path(
# f"./results_{datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')}")
inp.driver.sol_path = pathlib.Path(
"./results_struct")
"./results1")
inp.simulation.typeof = "single"
inp.systems.sett.s1.solution = "static"
inp.systems.sett.s1.solver_library = "diffrax"
inp.systems.sett.s1.solver_function = "newton"
inp.systems.sett.s1.solver_settings = dict(rtol=1e-6,
atol=1e-6,
max_steps=50,
inp.systems.sett.s1.solver_settings = dict(rtol=1e-4,
atol=1e-4,
max_steps=100,
norm="linalg_norm",
kappa=0.01)
# inp.systems.sett.s1.solver_library = "scipy"
# inp.systems.sett.s1.solver_function = "root"
# inp.systems.sett.s1.solver_settings = dict(method='hybr',#'krylov',
# tolerance=1e-9)
#inp.systems.sett.s1.label = 'dq_001001'
inp.systems.sett.s1.xloads.follower_forces = True
inp.systems.sett.s1.xloads.follower_points = [[25, 2], [48, 2]]
inp.systems.sett.s1.xloads.modalaero_forces = True
inp.systems.sett.s1.xloads.x = [0.,1.]
inp.systems.sett.s1.t = [0., 0.25, 0.5, 0.6, 0.7, 0.72]
inp.systems.sett.s1.aero.c_ref = 3.
inp.systems.sett.s1.aero.u_inf = 160.
inp.systems.sett.s1.aero.rho_inf = 0.778
inp.systems.sett.s1.aero.poles = "./AERO/PolesDd1c7F1Scao-50.npy"
inp.systems.sett.s1.aero.A = f"./AERO/ADd1c7F1Scao-50.npy"
#inp.systems.sett.s1.aero.C = f"./AERO/QhxDd1c7F1Scao-50.npy"
inp.systems.sett.s1.aero.Q0_rigid = f"./AERO/QhxDd1c7F1Scao-50.npy"
inp.systems.sett.s1.aero.qalpha = jnp.array(([0., 0., 0, 0, 0, 0],
[0., 4 * jnp.pi / 180, 0, 0, 0, 0]))

inp.systems.sett.s1.xloads.x = [0, 1, 2, 3, 4, 5, 6]
inp.systems.sett.s1.xloads.follower_interpolation = [[0.,
2e5,
2.5e5,
3.e5,
4.e5,
4.8e5,
5.3e5],
[0.,
2e5,
2.5e5,
3.e5,
4.e5,
4.8e5,
5.3e5]
]
inp.systems.sett.s1.t = [1, 2, 3, 4, 5, 6]

#config = configuration.Config(inp)

# path2config = pathlib.Path("./config.yaml")
config = configuration.Config(inp)
#configuration.dump_to_yaml(path2config, config, with_comments=True)

Expand Down
3 changes: 2 additions & 1 deletion feniax/intrinsic/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ def arg_10g15(
**kwargs,
):
eta_0 = kwargs["eta_0"]
x = sys.xloads.x
gamma2 = sol.data.couplings.gamma2
omega = sol.data.modes.omega
qalpha = sys.aero.qalpha
aero = getattr(sol.data, f"modalaeroroger_{sys.name}")
return (eta_0, gamma2, omega, qalpha, aero.A0hat, aero.C0hat)
return (eta_0, gamma2, omega, x, qalpha, aero.A0hat, aero.C0hat)


@catter2library
Expand Down
6 changes: 3 additions & 3 deletions feniax/intrinsic/dq_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def _dq_10g121(q2):
def dq_10g15(q, *args):
"""Manoeuvre under qalpha."""

(eta_0, gamma2, omega, qalpha, A0, C0) = args[0]
(eta_0, gamma2, omega, x, qalpha, A0hat, C0hat, t) = args[0]
q0 = -q / omega
F = omega * q - common.contraction_gamma2(gamma2, q)
F += xloads.eta_steadyaero(q0, A0)
F += xloads.eta_manoeuvre(qalpha, A0)
F += xloads.eta_steadyaero(q0, A0hat)
F += xloads.eta_manoeuvre(t, x, qalpha, C0hat)
F += eta_0
return F

Expand Down
6 changes: 4 additions & 2 deletions feniax/intrinsic/xloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ def eta_steadyaero(q0: jnp.ndarray, A0hat: jnp.ndarray):


@jax.jit
def eta_manoeuvre(qalpha: jnp.ndarray, C0hat: jnp.ndarray):
eta = C0hat @ qalpha
def eta_manoeuvre(t, x, qalpha: jnp.ndarray, C0hat: jnp.ndarray):

qalpha_ti = linear_interpolation(t, x, qalpha)
eta = C0hat @ qalpha_ti
return eta


Expand Down
2 changes: 2 additions & 0 deletions feniax/preprocessor/containers/intrinsicmodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ def __post_init__(self):
if self.u_inf is not None and self.rho_inf is not None:
q_inf = 0.5 * self.rho_inf * self.u_inf**2
object.__setattr__(self, "q_inf", q_inf)
if isinstance(self.Q0_rigid, (str, pathlib.Path)):
object.__setattr__(self, "Q0_rigid", jnp.load(self.Q0_rigid))
if isinstance(self.A, (str, pathlib.Path)):
object.__setattr__(self, "A", jnp.load(self.A))
if isinstance(self.B, (str, pathlib.Path)):
Expand Down

0 comments on commit 242b111

Please sign in to comment.