commit 2d5b06d4ade46eb4bbc4187ea3b1d970eed19cd8 Author: Sebastián Santisi Date: Fri Apr 19 02:46:38 2024 +0000 Commit inicial diff --git a/aspas_126m_85.stl b/aspas_126m_85.stl new file mode 100644 index 0000000..3a4b658 Binary files /dev/null and b/aspas_126m_85.stl differ diff --git a/casa_80.stl b/casa_80.stl new file mode 100644 index 0000000..7ef990d Binary files /dev/null and b/casa_80.stl differ diff --git a/cuerpo_126m_50.stl b/cuerpo_126m_50.stl new file mode 100644 index 0000000..a8a46b6 Binary files /dev/null and b/cuerpo_126m_50.stl differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..08f4c25 --- /dev/null +++ b/index.html @@ -0,0 +1,542 @@ + + + + + + + + +
+ +
¡SIMULAR!
+ +

Rotá tu
dispositivo

+ +
+ + diff --git a/logooscuro.png b/logooscuro.png new file mode 100644 index 0000000..dde96af Binary files /dev/null and b/logooscuro.png differ diff --git a/rotar_telefono.png b/rotar_telefono.png new file mode 100644 index 0000000..ec712b2 Binary files /dev/null and b/rotar_telefono.png differ diff --git a/server.py b/server.py new file mode 100644 index 0000000..855c27f --- /dev/null +++ b/server.py @@ -0,0 +1,22 @@ +from flask import Flask +from flask import request +import json + +app = Flask(__name__) + +import xxx + +@app.route("/", methods=['GET', 'POST']) +def index(): + if request.method == 'POST': + if request.data: + params = json.loads(request.data.decode(encoding='utf-8')) + pos = params['pos']; + ws = xxx.run(pos); + return { + 'pos': pos, + 'ws': ws, + } + +if __name__ == "__main__": + app.run(host='0.0.0.0', port='1234') diff --git a/spring.js b/spring.js new file mode 100644 index 0000000..cb92868 --- /dev/null +++ b/spring.js @@ -0,0 +1,34 @@ +import * as THREE from 'three'; + +// https://discourse.threejs.org/t/solved-create-a-spring/45135/9 +class Spring extends THREE.Mesh{ + constructor(radius, turns, segmentsPerTurn, height, growth, material){ + let g = new THREE.CylinderGeometry(0.005, 0.005, 1, 16, segmentsPerTurn * turns).translate(0, 0.5, 0).rotateX(Math.PI * 0.5); + let initPos = g.attributes.position.clone(); + super(g, material); + this.radius = radius; + this.turns = turns; + this.segmentsPerTurn = segmentsPerTurn; + this.height = height; + this.growth = growth; + + this.update = () => { + let _n = new THREE.Vector3(0, 1, 0), _v3 = new THREE.Vector3(), _s = new THREE.Vector3(); + + let pos = g.attributes.position; + for(let i = 0; i < initPos.count; i++){ + let ratio = initPos.getZ(i) * this.growth; + let angle = this.turns * Math.PI * 2 * ratio; + _v3.fromBufferAttribute(initPos, i).setZ(0); + _v3.applyAxisAngle(_n, angle + Math.PI * 0.5); + _v3.add(_s.setFromCylindricalCoords(this.radius, angle, this.height * ratio)); + pos.setXYZ(i, ... _v3); + } + g.computeVertexNormals(); + pos.needsUpdate = true; + + } + } +} + +export { Spring }; diff --git a/xxx.py b/xxx.py new file mode 100644 index 0000000..8c6a44f --- /dev/null +++ b/xxx.py @@ -0,0 +1,82 @@ +from py_wake.wind_turbines import WindTurbine +from py_wake.wind_turbines.power_ct_functions import PowerCtTabular +from py_wake.site._site import UniformSite +from py_wake.wind_farm_models import PropagateDownwind +from py_wake.deficit_models.gaussian import TurboGaussianDeficit +from py_wake.flow_map import XYGrid + +import numpy as np + +D = 126 #Diametro del wT +h = 90 #Altura del WT +U_ref = 8 + + +initial_position = np.array([[ 1 , 1], + [ 2. , 2], + [ 4 , 4], + [ 1 , 4], + [ 2 , 4], + [ 3 , 4], + [ 1 , 5], + [ 2 , 5], + [ 5 , 5]]) + + +def py_wake_Initial_Cong(D,name,h,U_ref,initial_position=initial_position): + + #Curvas del WT + power_curve = np.array([ + [ 0.1, 1.000], + [ 4.5, 267.7], + [ 5.0, 387.6], + [ 5.5, 534.0], + [ 6.0, 707.4], + [ 6.5, 910.0], + [ 7.0, 1142.7], + [ 7.5, 1407.5], + [ 8.0, 1707.1], + [ 8.5, 2047.3], + [ 9.0, 2430.6]]) * [1, 1000] + + + ct_curve = np.array([ + [ 0.1, 0.100], + [ 4.5, 0.928], + [ 5.0, 0.892], + [ 5.5, 0.861], + [ 6.0, 0.835], + [ 6.5, 0.812], + [ 7.0, 0.792], + [ 7.5, 0.776], + [ 8.0, 0.7702530978349217], + [ 8.5, 0.762], + [ 9.0, 0.763]]) + + + return WindTurbine(name=name, + diameter=D, + hub_height=h, + powerCtFunction=PowerCtTabular(power_curve[:, 0], + power_curve[:, 1], + 'w',ct_curve[:, 1], + method='linear')) + + + + + + +windTurbines = py_wake_Initial_Cong(D, 'NREL_5MW', h, U_ref) + +def run(initial_position=initial_position, U_ref=U_ref): + initial_position = np.array(initial_position); + site = UniformSite(p_wd=[1], + ws=U_ref, + initial_position=initial_position*D) + wt_x, wt_y = site.initial_position.T/D + wfm = PropagateDownwind(site, windTurbines, wake_deficitModel=TurboGaussianDeficit()) + grid = XYGrid(x=np.arange(0, 10.01, 0.1)*126, y=np.arange(0, 10.01, 0.1)*126) + xa = wfm(x=wt_x*126, y=wt_y*126, wd=0, yaw=0).flow_map(grid) + ws = xa.WS_eff + return ws[:,:,0,0].values[:,:,0].tolist()