Forum
Important Notice for New User Registrations
To combat an increasing number of spam and bot registrations, we now manually approve all new user registrations. While this may cause a delay until your account is approved, this step is essential to ensure the quality and security of this forum.
To help us verify your registration as legitimate, please use a clear name as user name or an official email address (such as a work, university, or similar address). If you’re concerned that we may not recognize your registration as non-spam, feel free to email us at with a request to approve your username.
add new swap parameter
Quote from FAWEI on 4. February 2025, 15:34Hi David,
Happy new year! (It’s the Chinese New Year!). Nowadays, I have some problems with the simulation.
Qblade has been compiled. But if I want to swap new parameters to the controller, how can I do it?
I looked at the code of Qblade2.0.4. In the QControl.cpp file, the parameters are passed by swapping to the array1[ ] (e.g. array1[1] = Ctrl_Vars[6];). However, there are many conflicts between the code of Qblade2.0.4 and the new model file, so it is difficult for me to run my new model with the source code of Qblade2.0.4. Is there any good way to define new swap data in the newly released QBladeCE_2.0.8.3_win version? For example, I want to swap the wind attack angle or lift force to array1[3000].
Also, what is Ctrl_Vars[ ] in QControl.cpp file? I am a little confused about the appearance of this array.
I look forward to your answer and thank you very much for your help! ! !
Regards
Fawei
Hi David,
Happy new year! (It’s the Chinese New Year!). Nowadays, I have some problems with the simulation.
Qblade has been compiled. But if I want to swap new parameters to the controller, how can I do it?
I looked at the code of Qblade2.0.4. In the QControl.cpp file, the parameters are passed by swapping to the array1[ ] (e.g. array1[1] = Ctrl_Vars[6];). However, there are many conflicts between the code of Qblade2.0.4 and the new model file, so it is difficult for me to run my new model with the source code of Qblade2.0.4. Is there any good way to define new swap data in the newly released QBladeCE_2.0.8.3_win version? For example, I want to swap the wind attack angle or lift force to array1[3000].
Also, what is Ctrl_Vars[ ] in QControl.cpp file? I am a little confused about the appearance of this array.
I look forward to your answer and thank you very much for your help! ! !
Regards
Fawei

Quote from David on 4. February 2025, 16:17Dear Fawei,
happy new year to you as well.
As mentioned in a previous post, it is challenging for us to continuously publish the source code for the latest versions of QBlade-CE. You can find more details here:
https://qblade.org/qblade-forum/topic/mismatch-between-source-code-and-structure-file/
That being said, if you choose to fork your own version of QBlade based on an older release, you will not be able to work with the latest model and project files available on our website. Instead, you will need to use models compatible with your forked version’s functionality.
Regarding your inquiry about adding turbine data to specific positions in the controller SWAP array: This functionality is available out of the box in the latest version of QBlade. You can assign any simulation variable from QBlade to any position within the controller SWAP array—or even within the array of a custom library. For more details, please refer to the documentation:
BR,
David
Dear Fawei,
happy new year to you as well.
As mentioned in a previous post, it is challenging for us to continuously publish the source code for the latest versions of QBlade-CE. You can find more details here:
https://qblade.org/qblade-forum/topic/mismatch-between-source-code-and-structure-file/
That being said, if you choose to fork your own version of QBlade based on an older release, you will not be able to work with the latest model and project files available on our website. Instead, you will need to use models compatible with your forked version’s functionality.
Regarding your inquiry about adding turbine data to specific positions in the controller SWAP array: This functionality is available out of the box in the latest version of QBlade. You can assign any simulation variable from QBlade to any position within the controller SWAP array—or even within the array of a custom library. For more details, please refer to the documentation:
https://docs.qblade.org/src/user/turbine/controller.html#sending-turbine-data-to-a-wind-turbine-controller
BR,
David
Quote from FAWEI on 5. February 2025, 01:39Dear David,
Thank you for your detailed response! I have tried the method you attached, and it worked perfectly. The document is really helpful!
Regards,
Fawei
Dear David,
Thank you for your detailed response! I have tried the method you attached, and it worked perfectly. The document is really helpful!
Regards,
Fawei
Quote from FAWEI on 6. February 2025, 05:45Dear David,
As I put the ”Angle of Attack BLD_1 pos 0.500 [deg]” in ”SWAP [3002]” and export two sets of result data (one is ”Angle of Attack BLD_1 pos 0.500 [deg]” and the other is ”SWAP [3002]”), I found there is a mistake. The result of ”SWAP [3002]” corresponds to the previous time step of “Angle of Attack BLD_1 pos 0.500 [deg]”.
# Export File Created with QBlade CE v2.0.8.1_beta windows on 05.02.2025 at 17:51:00
[New Turbine Simulation: SANDIA_34m_AE]
Time [s] SWAP[3002] [-]
0.0000000e+00 0.0000000e+00
9.9999998e-03 1.5583878e+00
2.0000000e-02 1.7951584e+00
2.9999999e-02 1.9276199e+00
3.9999999e-02 2.1531219e+00
5.0000001e-02 2.3933411e+00
5.9999999e-02 2.6925659e+00
7.0000000e-02 2.9741287e+00
7.9999998e-02 3.2474136e+00
9.0000004e-02 3.4815445e+00
1.0000000e-01 3.6884537e+00# Export File Created with QBlade CE v2.0.8.1_beta windows on 05.02.2025 at 17:50:56
[New Turbine Simulation: SANDIA_34m_AE]
Time [s] Angle of Attack BLD_1 pos 0.500 [deg]
0.0000000e+00 1.5583878e+00
9.9999998e-03 1.7951584e+00
2.0000000e-02 1.9276199e+00
2.9999999e-02 2.1531219e+00
3.9999999e-02 2.3933411e+00
5.0000001e-02 2.6925659e+00
5.9999999e-02 2.9741287e+00
7.0000000e-02 3.2474136e+00
7.9999998e-02 3.4815445e+00
9.0000004e-02 3.6884537e+00
1.0000000e-01 3.8778000e+00
Regards,
Fawei
Dear David,
As I put the ”Angle of Attack BLD_1 pos 0.500 [deg]” in ”SWAP [3002]” and export two sets of result data (one is ”Angle of Attack BLD_1 pos 0.500 [deg]” and the other is ”SWAP [3002]”), I found there is a mistake. The result of ”SWAP [3002]” corresponds to the previous time step of “Angle of Attack BLD_1 pos 0.500 [deg]”.
# Export File Created with QBlade CE v2.0.8.1_beta windows on 05.02.2025 at 17:51:00
[New Turbine Simulation: SANDIA_34m_AE]
Time [s] SWAP[3002] [-]
0.0000000e+00 0.0000000e+00
9.9999998e-03 1.5583878e+00
2.0000000e-02 1.7951584e+00
2.9999999e-02 1.9276199e+00
3.9999999e-02 2.1531219e+00
5.0000001e-02 2.3933411e+00
5.9999999e-02 2.6925659e+00
7.0000000e-02 2.9741287e+00
7.9999998e-02 3.2474136e+00
9.0000004e-02 3.4815445e+00
1.0000000e-01 3.6884537e+00
# Export File Created with QBlade CE v2.0.8.1_beta windows on 05.02.2025 at 17:50:56
[New Turbine Simulation: SANDIA_34m_AE]
Time [s] Angle of Attack BLD_1 pos 0.500 [deg]
0.0000000e+00 1.5583878e+00
9.9999998e-03 1.7951584e+00
2.0000000e-02 1.9276199e+00
2.9999999e-02 2.1531219e+00
3.9999999e-02 2.3933411e+00
5.0000001e-02 2.6925659e+00
5.9999999e-02 2.9741287e+00
7.0000000e-02 3.2474136e+00
7.9999998e-02 3.4815445e+00
9.0000004e-02 3.6884537e+00
1.0000000e-01 3.8778000e+00
Regards,
Fawei

Quote from David on 6. February 2025, 12:35Dear Fawei,
what you are observing is the expected behavior. QBlade employs a staggered simulation or loose coupling approach between the controller and the aeroelastic solver. In this method, the controller parameters used for the current timestep are derived from the variables computed in the previous timestep. This is the common approach used by all aeroealstic codes when coupled with a controller library.
BR,
David
Dear Fawei,
what you are observing is the expected behavior. QBlade employs a staggered simulation or loose coupling approach between the controller and the aeroelastic solver. In this method, the controller parameters used for the current timestep are derived from the variables computed in the previous timestep. This is the common approach used by all aeroealstic codes when coupled with a controller library.
BR,
David
