Skip to content

Commit

Permalink
Merge pull request #289 from ImperialCollegeLondon/develop
Browse files Browse the repository at this point in the history
preparing for version 2.3 update
  • Loading branch information
kccwing committed May 10, 2024
2 parents 8d70685 + da3b56a commit e089c4f
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "release version",
"message": "2.2",
"message": "2.3",
"color": "green"
}
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@

# General information about the project.
project = 'SHARPy'
copyright = '2023, LoCA Lab ICL'
copyright = '2024, LoCA Lab ICL'
author = 'Aeroelastics Lab, Imperial College London'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.2'
version = '2.3'
# The full version, including alpha/beta/rc tags.
release = '2.2'
release = '2.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 8 additions & 0 deletions docs/source/content/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ to your taste. This is compatible with both standalone and Anaconda installation

## Using SHARPy from a Docker container

> **Tip** To install the Python environment, miniconda needs approximatelly 16GB of
> memory. It is recommended to have at least that amount available for the
> container in which you are building SHARPy.
Docker containers are similar to lightweight virtual machines. The SHARPy container
distributed through [Docker Hub](https://hub.docker.com/) is a CentOS 8
machine with the libraries compiled with `gfortran` and `g++` and an
Expand Down Expand Up @@ -277,6 +281,10 @@ docker cp sharpy:/my_file.txt my_file.txt # copy from container to host
```
The `sharpy:` part is the `--name` argument you wrote in the `docker run` command.

**Enjoy!**

## Testing with Docker

You can run the test suite once inside the container as:
```
cd sharpy_dir
Expand Down
2 changes: 1 addition & 1 deletion docs/source/includes/linear/src/lingebm/newmark_ss.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
newmark_ss
----------

.. automodule:: sharpy.linear.src.lingebm.newmark_ss
.. autofunction:: sharpy.linear.src.lingebm.newmark_ss
22 changes: 16 additions & 6 deletions sharpy/aero/models/aerogrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def __init__(self):

self.cs_generators = []

self.initial_strip_z_rot = None

def generate(self, data_dict, beam, settings, ts):
super().generate(data_dict, beam, settings, ts)

Expand All @@ -44,6 +46,15 @@ def generate(self, data_dict, beam, settings, ts):
self.ini_info = AeroTimeStepInfo(self.dimensions,
self.dimensions_star)

# Initial panel orientation, used when aligned grid is off
self.initial_strip_z_rot = np.zeros([self.n_elem, 3])
if not settings['aligned_grid'] and settings['initial_align']:
for i_elem in range(self.n_elem):
for i_local_node in range(3):
Cab = algebra.crv2rotation(beam.ini_info.psi[i_elem, i_local_node, :])
self.initial_strip_z_rot[i_elem, i_local_node] = \
algebra.angle_between_vectors_sign(settings['freestream_dir'], Cab[:, 1], Cab[:, 2])

# load airfoils db
# for i_node in range(self.n_node):
for i_elem in range(self.n_elem):
Expand Down Expand Up @@ -288,6 +299,7 @@ def generate_zeta_timestep_info(self, structure_tstep, aero_tstep, beam, setting
generate_strip(node_info,
self.airfoil_db,
self.aero_settings['aligned_grid'],
initial_strip_z_rot=self.initial_strip_z_rot[i_elem, i_local_node],
orientation_in=self.aero_settings['freestream_dir'],
calculate_zeta_dot=True))
# set junction boundary conditions for later phantom cell creation in UVLM
Expand All @@ -300,8 +312,6 @@ def generate_phantom_panels_at_junction(self, aero_tstep):
for i_surf in range(self.n_surf):
aero_tstep.flag_zeta_phantom[0, i_surf] = self.data_dict["junction_boundary_condition"][0,i_surf]



@staticmethod
def compute_gamma_dot(dt, tstep, previous_tsteps):
r"""
Expand Down Expand Up @@ -372,6 +382,7 @@ def compute_gamma_dot(dt, tstep, previous_tsteps):


def generate_strip(node_info, airfoil_db, aligned_grid,
initial_strip_z_rot,
orientation_in=np.array([1, 0, 0]),
calculate_zeta_dot = False,
first_twist=True):
Expand Down Expand Up @@ -447,11 +458,10 @@ def generate_strip(node_info, airfoil_db, aligned_grid,
# Cab transformation
Cab = algebra.crv2rotation(node_info['beam_psi'])

rot_angle = algebra.angle_between_vectors_sign(orientation_in, Cab[:, 1], Cab[:, 2])
if np.sign(np.dot(orientation_in, Cab[:, 1])) >= 0:
rot_angle += 0.0
if aligned_grid:
rot_angle = algebra.angle_between_vectors_sign(orientation_in, Cab[:, 1], Cab[:, 2])
else:
rot_angle += -2*np.pi
rot_angle = initial_strip_z_rot
Crot = algebra.rotation3d_z(-rot_angle)

c_sweep = np.eye(3)
Expand Down

0 comments on commit e089c4f

Please sign in to comment.