CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   possible to have a controller on inlet turbulence intensity? (https://www.cfd-online.com/Forums/cfx/165851-possible-have-controller-inlet-turbulence-intensity.html)

mrshives January 27, 2016 16:33

possible to have a controller on inlet turbulence intensity?
 
Is it possible to define the inlet turbulence intensity to be dependent on a volume Average of intensity over a region in the mesh?


A) I have two fluid domains: 1) a Main domain, 2) a ROTOR domain (which is contained within Main)
B) I want to set the inflow turbulence intensity to achieve the desired (average) intensity in the ROTOR domain
C) My strategy is to use a simple controller using the previous value of inlet intensity (“inIold”) and difference between my target intensity for the ROTOR (“SpecAVti”) and the current intensity at the ROTOR (“r001cylAVti”)
D) Since I’m using the value of inlet intensity from the previous timestep I do a precursor simulation, and use that as initialization for the sim.

E) the problem seems to be that I can’t set the inflow intensity using any parameters from the simulation… I get the following error message:

Error processing expression 'Fractional Intensity'.
The expression is invalid because:
TI is not available for use in this term
inIold is not available for use in this term

Error processing expression: Fractional Intensity = inI



F) Here are the relevant bits of CCL for my problem:

%% expressions defining controller for inlet intensity
LIBRARY:
CEL:
EXPRESSIONS:
SpecAVti = 0.1
inI = inIold + 0.5 * (SpecAVti - r001cylAVti)
inL = 20 [m]

r001cylAVti = volumeAve(TI)@ROTOR001
END
END
END

ADDITIONAL VARIABLE: TI % this is defined in ROTOR
Option = Definition
Tensor Type = SCALAR
Units = [ ]
Variable Type = Specific
END

%% ROTOR domain:
DOMAIN: ROTOR001
Coord Frame = Coord 0
Domain Type = Fluid
Location = ROTOR001

FLUID MODELS:
ADDITIONAL VARIABLE: TI
Additional Variable Value = sqrt( 2/3*ke ) / sqrt(u^2+v^2)
Option = Algebraic Equation
END

END

ADDITIONAL VARIABLE: inIold %% this is defined in Main
Option = Definition
Tensor Type = SCALAR
Units = [ ]
Update Loop = TRANS_LOOP %% so I get the value from the previous iteration
Variable Type = Unspecified
END

%% Main domain
DOMAIN: Main
Coord Frame = Coord 0
Domain Type = Fluid
Location = MAIN

ADDITIONAL VARIABLE: inIold
Additional Variable Value = inI
Option = Algebraic Equation
END


%% inlet boundary specification (to Main Domain)
BOUNDARY: inlet
Boundary Type = INLET
Location = OB1
BOUNDARY CONDITIONS:
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Option = Cartesian Velocity Components
U = inU
V = inV
W = inW
END
TURBULENCE:
Eddy Length Scale = inL
Fractional Intensity = inI
Option = Intensity and Length Scale
END
END
END

%% HERE IS THE ERROR MESSAGE

Error processing expression 'Fractional Intensity'.
The expression is invalid because:
TI is not available for use in this term
inIold is not available for use in this term

Error processing expression: Fractional Intensity = inI

ghorrocks January 28, 2016 05:17

I would just do a few simulations at some guessed intensities. Guess a value which will be too high and another too low and do some simple numerical analysis to home in on the correct value. This is MUCH simpler then doing a control loop to automatically find it. You would spend ages developing a control loop to replace only a few minutes work - does not sound like a productive use of time to me.

mrshives February 1, 2016 15:25

Thanks for the input. For, me the time invested in a controller would be well spent, because I would like to be able to do many different turbulence scenarios.

I'm developing a RANS-based methodology for momentum-source modeling for wind/tidal turbines. Part of the method involves tuning the momentum sources to match experimental performance data. And the tuned performance coefficients depend on the local velocity at the turbine location, which in turn is dependent on turbulent mixing. Thus, I need to run the tuning simulations over a range of turbulence scenarios, and a range of turbine operating points. Thus, the number of simulations becomes large quite quickly. I'm using scripting to automate the simulation setup and post-processing. Automating the inflow turbulence is the last piece in the puzzle for a fully automated method.

I would like to be able to apply the method quickly to new turbines, so automation could save much time in the long run.

mrshives February 1, 2016 15:29

I suppose I could write the scripting to adjust the inflow turbulence in a control strategy external to the CFX runs. Essentially what you describe Glen, but automated.

I thought it could be more efficient to have the control strategy internal to CFX however, since that would require one run per case, rather than several.

ghorrocks February 1, 2016 15:53

Control loops have their own stability and accuracy issues. So putting a control loop inside a CFD simulation which also has its own stability and accuracy issues makes for a whole new world of weird instability modes and problems. This will mean doing everything inside CFX will be tricky to develop and difficult to monitor (if it crashes, did the simulation diverge or did the control loop go bezerk? Or some combination of both?) That is why your approach of doing the control loop bit outside of CFX will be much easier to develop, monitor and run compared to doing it inside CFX.

mrshives February 2, 2016 03:59

I agree fully that such control loops may destabilize a simulation, however I do think that its a very case-specific problem. I have created control strategies to auto-tune momentum source strength to achieve target values for integrated streamwise force (rotor thrust) and power (torque) which are very simple and robust in CFX.

So, I'm not fully discouraged yet.

I'm interested in finding out how one might go about making a control strategy for altering inlet values during a sim run. I actually suspect that CFX will not allow inlet conditions to be modified during a steady-state run, and that is likely the reason why I'm getting "variable not available for this term" errors. Can anyone confirm this?

Furthermore, is it possible to modify the RULES file to modify such restrictions?

ghorrocks February 2, 2016 17:55

You can change inlet parameters during a steady state run. But there are restrictions on what variables you can use in a function controlling an inlet. Modifying the RULES file can sidestep some of these restrictions - but of course the restriction is there for a good reason so you do this at your own peril.


All times are GMT -4. The time now is 21:44.