wt-demo-1.lisp 13 KB
Newer Older
Teodor Gelu Chiciudean's avatar
Teodor Gelu Chiciudean committed
1
2
3
4
5
6
7
(in-package :wind)

(define-object demo-1 (base-ajax-sheet)
  ;;base-ajax-sheet)
 
  :input-slots 
  
8
  ((css-style  "/css-demo-1/style-wind-1.css"))
Teodor Gelu Chiciudean's avatar
Teodor Gelu Chiciudean committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
  
  :computed-slots 
  ((additional-header-content 
    (with-cl-who-string ()
      (:p (when *developing?* (str (the development-links))))
      (:style :type "text/css" :media "all"
              (str (format nil " @import url(~a);" (the css-style))))))
   
   (title "WT Demo 1")
   (main-sheet-body
    (with-cl-who-string ()
      (:div :id "wrapper"
            (:div :id "header"(:h1 "Wind Turbine Geometry Demo"))
            (:div :id "left"
                  (:div :id "logo"
                        (:h1 "KE-Works S.R.L. & Genworks International")
                        (:p "It's all possible"))
                  (:div :id "news"
                        (:h2 "General inputs")
                        (:div :id "end-input-head")
                        (str (the general-inputs main-div)))
                  (:div :id "end-input")
                  (:div :id "disp-comp"   
                        (:h2 "Displayed component")        
                        (:div :id "end-input-head")     
                        (:p)
                        (str (the displayed-component main-div))))
            (:div :id "data-export"
                  (:div :id "left-export"
                        (:div :id "data-export-t"
                              (:h2 "Data Export")
                              (:div :id "end-input-head")
                              (str (the export-section main-div))))
                  (:div :id "left-export"
                        (:div :id "data-export-t"
                              (:h2 "Turbine characteristics")
                              (:div :id "end-input-head")
                              (str (the turbine-characteristics-1 main-div))))
                  (:div :id "left-export"
                        (:div :id "data-export-t"
                              (:h2 "Turbine characteristics")
                              (:div :id "end-input-head")
                              (str (the turbine-characteristics-2  main-div))))
                  (:div :id "right"
                        (:h2 
                         (:form " WT reference input data file"
                                (:input  :size "25" :type "file" :name "ref-input" :accept="data/")))
                        (str (the  graphics graphics main-div))
                        (:h2 "Description")
                        (:div :class "scroll"
                              (:p "This quantification was made based on the next assumption: price of the wind turbine 1 mill/MW and 451/t price of raw steel plates. In the case of transport and installation, an equal value was allocated arbitrary to serve as input for the model implementation. Even though the assumptions reflects the reality with a ± 10% error, the assumed cost structure serves as a reference to develop a parametric model in which the identified manufacturing transport and installation processes are deeply investigated. The presented cost structure is valid just for the existing tower concepts. To account for the new concept, the identified cost structure has to be breaked in its constituent sub-parts (human resources, machining time, machining energy consumption, etc.). The model should be able to substitute processes like longitudinal welding with drilling and bolt-assembly."))))
            (:div :class"clear")
            (:div :id "footer"
                  (:div :id "copyright"
                        "Copyright © 2011 Copyright KE-Works S.R.L Romania and Genworks International All right reserved.")
                  (:div :id "footerline")
                  )))))     
  
  
  :objects
  
  ((general-inputs :type 'general-inputs)
   (displayed-component :type 'displayed-component)
   (export-section :type  'export-section)
   (turbine-characteristics-1 :type  'turbine-characteristics-1)
   (turbine-characteristics-2 :type  'turbine-characteristics-2)
   (graphics :type 'graphics
             :blade-concepts (the displayed-component blade-concepts value)
             :number-of-blades (the general-inputs number-of-blades value)
             :geometry (the displayed-component component-display-control value)
             )))

(define-object general-inputs (sheet-section)
  :computed-slots
  ((main-view (with-cl-who-string ()
                ((:table :class "input_area")
                 ((:col  :width "90%")
                  (:tr (:td) (:td))
                  (:tr
                   ((:td) "Number of blades")
                   ((:td :align "right") (str (the number-of-blades html-string))))
                  (:tr 
                   (:td "Pitch angle")
                   ((:td :align "right") (str (the hub-hight html-string))))
                  (:tr 
                   (:td "Tilt angle")
                   ((:td :align "right") (str (the tilt-angle html-string))))
                  (:tr 
                   (:td "Precone angle")
                   ((:td :align "right") (str (the precone-angle html-string)))))))))
     
  :objects
  ((number-of-blades :type 'text-form-control
                     :default 3
                     :prompt nil
                     :size 1
                     :ajax-submit-on-change? t)
   
   (hub-hight :type 'text-form-control
              :default 0
              :prompt nil
              :size 1
              :ajax-submit-on-change? t)               
   
   (tilt-angle :type 'text-form-control
               :prompt nil
               :default 13
               :size 1
               :ajax-submit-on-change? t)                          
   
   (precone-angle :type 'text-form-control
                  :prompt nil
                  :default 13
                  :size 1
                  :ajax-submit-on-change? t)))
   
(define-object export-section (sheet-section)
  
  :computed-slots
  
  ((main-view (with-cl-who-string ()
                ((:table :class "input_area")
                 ((:col  :width "80%")
                  (:tr (:td) (:td))
                  (:tr
                   ((:td) "IGES file")
                   ((:td :align "right") (:button  :onClick "www.ke-works.ro" (:i "Download"))))
                  (:tr 
                   (:td "STL file")
                   ((:td :align "right") (:button  :onClick "www.ke-works.ro" (:i "Download"))))
                  (:tr 
                   (:td "VRML file")
                   ((:td :align "right") (:button  :onClick "www.ke-works.ro" (:i "Download"))))
                  (:tr 
                   (:td "PNG")
                   ((:td :align "right") (:button  :onClick "www.ke-works.ro" (:i "Download"))))))))))

(define-object turbine-characteristics-1 (sheet-section)
  
  :computed-slots
    
  ((main-view (with-cl-who-string ()
                ((:table :class "input_area")
                 ((:col  :width "80%")
                  (:tr (:td) (:td))
                  (:tr
                   ((:td) "Total mass")
                   ((:td :align "right") (:a (str (format nil "~at"(the total-mass))))))
                  (:tr 
                   (:td "Rotor mass")
                   ((:td :align "right")  (:a (str (format nil "~at"(the rotor-mass))))))
                  (:tr 
                   (:td "Blade mass")
                   ((:td :align "right") (:a (str (format nil "~at"(the blade-mass))))))
                  (:tr 
                   (:td "Nacelle mass")
                   ((:td :align "right") (:a (str (format nil "~at"(the nacelle-mass))))))
                  (:tr 
                   (:td "Power output")
                   ((:td :align "right") (:a (str (format nil "~aMW"(the power-output))))))))))

 
    (total-mass 1200)
    (rotor-mass 300)
    (blade-mass 100)
    (nacelle-mass 400)
    (power-output 5)
   ))
 
(define-object turbine-characteristics-2 (sheet-section)
  
  :computed-slots
  
  ((main-view (with-cl-who-string ()
                ((:table :class "input_area")
                 ((:col  :width "80%")
                  (:tr (:td) (:td))
                  (:tr
                   ((:td) "Data 1 ...etc")
                   ((:td :align "right") (:a (str (format nil "~a"(the total-mass))))))
                  (:tr 
                   (:td "Data 2 ...etc")
                   ((:td :align "right")  (:a (str (format nil "~a"(the rotor-mass))))))
                  (:tr 
                   (:td "Data 3 ...etc")
                   ((:td :align "right") (:a (str (format nil "~a"(the blade-mass))))))
                  (:tr 
                   (:td "Data 4 ...etc")
                   ((:td :align "right") (:a (str (format nil "~a"(the nacelle-mass))))))
                  (:tr 
                   (:td "Data 5 ...etc")
                   ((:td :align "right") (:a (str (format nil "~a"(the power-output))))))))))
                 
   
   (total-mass 88888)
   (rotor-mass 88888)
   (blade-mass 88888)
   (nacelle-mass 88888)
   (power-output 88888)
   ))

(define-object graphics (base-ajax-sheet base-object)
  
  :input-slots (geometry number-of-blades blade-concepts)
  :computed-slots ((displayed-geometry 
                    (list 
                     :wt-assembly
                     (flatten (list (list-elements (the-object (the rotor rotor-assembly) hub))
                                    (mapcar #'(lambda(leaves) (list-elements leaves))
                                            (list-elements (the-object (the rotor rotor-assembly) blade)))
                                    (the rotor tower)
                                    (list-elements (the-object (the rotor rotor-assembly) turbine-nacelle))))
                                   
                     :rotor-assembly
                     (flatten (list 
                               (list-elements (the-object (the rotor rotor-assembly) hub))
                               (mapcar #'(lambda(leaves) (list-elements leaves))
                                       (list-elements (the-object (the rotor rotor-assembly) blade)))))
                     
                     :hub-assembly (list-elements (the-object (the rotor rotor-assembly) hub))
                     :nacell-assembly (list-elements (the-object (the rotor rotor-assembly) turbine-nacelle ))
                     :blade (list-elements (the-object (the rotor rotor-assembly) rotor-hidded))
                     :tower (list (the rotor tower))
                     
                     )))
  
  :objects               
  ((rotor :type 'assembly
          :blade-concepts (the blade-concepts)
          :nr-blades-data (the number-of-blades))
   
   (box :type 'surf::test-b-spline-surface
        :sequence (:size 30))
   
    (graphics :type 'base-ajax-graphics-sheet
              :image-format-default :png
              :view-direction-default :trimetric
              :viewport-border-default 0
              :display-list-objects (getf (the displayed-geometry) (the geometry ))
              :length 702
              :width 690)))
    
  
 (define-object displayed-component (sheet-section)
  :computed-slots
  ((main-view (with-cl-who-string ()
                (str (the component-display-control html-string))
                (:h3 (str (if (eql (the component-display-control value) :rotor-assembly)
                             "Blade concepts"       
                            "" )))
                
                (str (if (eql (the component-display-control value) :rotor-assembly)
                         (the blade-concepts html-string) ""))
                )))
               
   :objects               
   ((component-display-control :type 'menu-form-control
                              :choice-plist (list  :wt-assembly "Turbine assembly all comp."
                                                   :rotor-assembly "Rotor assembly"
                                                   :hub-assembly "Hub assembly"
                                                   :nacell-assembly "Nacell assembly"
                                                   :blade "Blade"
                                                   :tower "Tower") 
                                                   :default :wt-assembly
                                                   :size 1
                                                   :prompt nil
                                                   :ajax-submit-on-change? t)
    
    
    (blade-concepts :type 'menu-form-control
                              :choice-plist (list  :classic-blade "Classic blade"
                                                   :blade-with-flaps "Blade with flaps"
                                                   :blade-with-morfin-tip "Blade with morfin tip"
                                                   :blade-with-m-tip-flaps "Blade with M-tip-flaps")
                                                   :default  :classic-blade
                                                   :size 1
                                                   :prompt nil
                                                   :ajax-submit-on-change? t)
    
    
    
    ))



(publish-gwl-app "/demo-1"
                 "wind::demo-1")

297
298
(publish-directory :prefix "/css-demo-1"
                   :destination (format nil "~a" (merge-pathnames "css-demo-1" *data-pathname*)))