Changeset 2792 for palm/trunk/SOURCE


Ignore:
Timestamp:
Feb 7, 2018 6:45:29 AM (6 years ago)
Author:
Giersch
Message:

Bugfix for restart runs if the wind turbine model is used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/wind_turbine_model_mod.f90

    r2776 r2792  
    2626! -----------------
    2727! $Id$
     28! omega_rot_l has to be calculated after determining the indices for the hub in
     29! case of restart runs
     30!
     31! 2776 2018-01-31 10:44:42Z Giersch
    2832! wind_turbine_prerun flag is used to define if module
    2933! related parameters were outputted as restart data
     
    646650       IF ( ANY( omega_rot(1:nturbines) < 0.0 ) )  THEN
    647651          message_string = 'omega_rot < 0.0, Please set omega_rot to '     // &
    648                            'a value larger than or equal to zero'
     652                           'a value equal or larger than zero'
    649653          CALL message( 'wtm_check_parameters', 'PA0462', 1, 2, 0, 6, 0 )
    650654       ENDIF
     
    924928       ALLOCATE( index_nact(1:nturbines) )
    925929
    926 
    927        IF ( speed_control)  THEN
    928        
    929           CALL wtm_speed_control
    930 
    931           IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
    932 
    933              DO inot = 1, nturbines
    934 
    935                 IF ( nxl > i_hub(inot) ) THEN
    936                    torque_gen(inot) = 0.0_wp
    937                    omega_gen_f(inot) = 0.0_wp
    938                    omega_rot_l(inot) = 0.0_wp
    939                 ENDIF
    940 
    941                 IF ( nxr < i_hub(inot) ) THEN
    942                    torque_gen(inot) = 0.0_wp
    943                    omega_gen_f(inot) = 0.0_wp
    944                    omega_rot_l(inot) = 0.0_wp
    945                 ENDIF
    946 
    947                 IF ( nys > j_hub(inot) ) THEN
    948                    torque_gen(inot) = 0.0_wp
    949                    omega_gen_f(inot) = 0.0_wp
    950                    omega_rot_l(inot) = 0.0_wp
    951                 ENDIF
    952 
    953                 IF ( nyn < j_hub(inot) ) THEN
    954                    torque_gen(inot) = 0.0_wp
    955                    omega_gen_f(inot) = 0.0_wp
    956                    omega_rot_l(inot) = 0.0_wp
    957                 ENDIF
    958 
    959                 IF ( ( nxl <= i_hub(inot) ) .AND. ( nxr >= i_hub(inot) ) ) THEN
    960                    IF ( ( nys <= j_hub(inot) ) .AND. ( nyn >= j_hub(inot) ) ) THEN
    961 
    962                       omega_rot_l(inot) = omega_gen(inot) / gear_ratio
    963 
    964                    ENDIF
    965                 ENDIF
    966 
    967              END DO
    968 
    969           ENDIF
    970 
    971        ENDIF
    972 
    973930!
    974931!------------------------------------------------------------------------------!
     
    1033990       
    1034991       ENDDO
     992
     993!
     994!--    Call the wtm_init_speed_control subroutine and calculate the local
     995!--    omega_rot for the respective processor.
     996       IF ( speed_control)  THEN
     997       
     998          CALL wtm_speed_control
     999
     1000          IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN
     1001
     1002             DO inot = 1, nturbines
     1003
     1004                IF ( nxl > i_hub(inot) ) THEN
     1005                   torque_gen(inot) = 0.0_wp
     1006                   omega_gen_f(inot) = 0.0_wp
     1007                   omega_rot_l(inot) = 0.0_wp
     1008                ENDIF
     1009
     1010                IF ( nxr < i_hub(inot) ) THEN
     1011                   torque_gen(inot) = 0.0_wp
     1012                   omega_gen_f(inot) = 0.0_wp
     1013                   omega_rot_l(inot) = 0.0_wp
     1014                ENDIF
     1015
     1016                IF ( nys > j_hub(inot) ) THEN
     1017                   torque_gen(inot) = 0.0_wp
     1018                   omega_gen_f(inot) = 0.0_wp
     1019                   omega_rot_l(inot) = 0.0_wp
     1020                ENDIF
     1021
     1022                IF ( nyn < j_hub(inot) ) THEN
     1023                   torque_gen(inot) = 0.0_wp
     1024                   omega_gen_f(inot) = 0.0_wp
     1025                   omega_rot_l(inot) = 0.0_wp
     1026                ENDIF
     1027
     1028                IF ( ( nxl <= i_hub(inot) ) .AND. ( nxr >= i_hub(inot) ) ) THEN
     1029                   IF ( ( nys <= j_hub(inot) ) .AND. ( nyn >= j_hub(inot) ) ) THEN
     1030
     1031                      omega_rot_l(inot) = omega_gen(inot) / gear_ratio
     1032
     1033                   ENDIF
     1034                ENDIF
     1035
     1036             END DO
     1037
     1038          ENDIF
     1039
     1040       ENDIF
    10351041
    10361042!
Note: See TracChangeset for help on using the changeset viewer.