Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bemDraft #681

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
uodateUbem
  • Loading branch information
santiago-correa-89 committed Jan 23, 2024
commit 9bd81ee19226a70cd4bd5e4045a0105fc6f361ea
3 changes: 3 additions & 0 deletions src/core/assembler.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 208,9 @@
end

%md compute fluid forces on the element
if isempty(aeroNumericalParams)
aeroBool = false; % Used for uBEM first element of the interesection between nose and blase is computed as a frame without wind vel applied.
end
if aeroBool && fsBool
[FaeroElem, MataeroEelem] = frame_fluid_force( elemNodesxyzRefCoords, ...
elemCrossSecParams , ...
Expand Down
13 changes: 0 additions & 13 deletions src/elements/frame/auxiliar/readFoilData.m

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 15,13 @@
% You should have received a copy of the GNU General Public License
% along with ONSAS. If not, see <https://www.gnu.org/licenses/>.

function [ chordVector, aoa, cl, cd, cm, fstat, clinv, clfullysep ] = aeroBEMprops( aeroAirfoils, sectionData ) ;
function [ chordVector, aoast, liftCoef, dragCoef, momCoef] = uBEMAeroProps( twistList, chordList, polars )

for i = length(aeroAirfoils)
[aoa(:,i), cl(:,i), cd(:,i), cm(:,i), fstat(:,i), clinv(:,i), clfullysep(:,i)] = readairfoildata( aeroAirfoils(i) );
end
[aoast, liftCoef, dragCoef, momCoef ] = uBEMreadFoilData( polars ) ;

twist = sectionData(:,2); % Angle in DEGRESS
chord = sectionData(:,3);
chordVector = zeros( length(chordList), 3 );

for j = 1:length(twist)
chordVector(1,j) = [0, 0 , chord(j)] ;
for j = 1:length(twistList)
chordVector(j,3) = chordList(j) ;
end
end
12 changes: 12 additions & 0 deletions src/elements/frame/auxiliar/uBEMframeProps.m
Original file line number Diff line number Diff line change
@@ -0,0 1,12 @@
function [twist, chord, IDsection, radius, Idx1, Idx2] = uBEMframeProps(uBEMdataCoords, xs)

Idx1 = find(uBEMdataCoords(1:end, 1:3) == xs(1:3)', 1) ;
Idx2 = find(uBEMdataCoords(1:end, 1:3) == xs(4:6)', 1) ;

radius = [ uBEMdataCoords(Idx1, 7), uBEMdataCoords(Idx2, 7) ];

twist = [ 0 uBEMdataCoords(Idx1, 4) 0 0 uBEMdataCoords(Idx2, 4) 0 ]';
chord = [ 0 0 uBEMdataCoords(Idx1, 5) 0 0 uBEMdataCoords(Idx2, 5) ]';
IDsection = [ uBEMdataCoords(Idx1, 6), uBEMdataCoords(Idx2, 6) ];

end
43 changes: 43 additions & 0 deletions src/elements/frame/auxiliar/uBEMreadFoilData.m
Original file line number Diff line number Diff line change
@@ -0,0 1,43 @@
function [ aoa, cl, cd, cm ] = uBEMreadFoilData( polars )

% For uniform test
if iscell(polars) && numel(polars) >= 3
format = table2array(readtable( polars{3} ) );
[ row, ~ ] = size(format) ;
for i = 1:length(polars)
if i == 1 || i == 2 % First two columns are cylinder shapes
aoa(:,i) = format(:,1) ;
for j = 1:row
strucdata = table2array( readtable( polars{i} ) ) ;
cl(j,i) = strucdata(1,2);
cd(j,i) = strucdata(1,3);
cm(j,i) = strucdata(1,4);
end
else
strucdata = table2array( readtable( polars{i} ) );
if length(strucdata(:,1)) ~= row
[uniqueValues, ~, index] = unique(strucdata(:, 1));
rowsToKeep = accumarray(index, 1) == 1;
filteredData = strucdata(rowsToKeep, :) ;
aoa(:,i) = format(:, 1) ;
for j = 1:row
cl(j,i) = interp1( filteredData(:,1), filteredData(:,2), format(j, 1), 'linear', 'extrap' );
cd(j,i) = interp1( filteredData(:,1), filteredData(:,3), format(j, 1), 'linear', 'extrap' );
cm(j,i) = interp1( filteredData(:,1), filteredData(:,4), format(j, 1), 'linear', 'extrap' );
end
else
aoa(:,i) = strucdata(:,1) ;
cl(:,i) = strucdata(:,2) ;
cd(:,i) = strucdata(:,3) ;
cm(:,i) = strucdata(:,4) ;
end
end
end
else
strucdata = table2array( readtable( polars{1} ) ) ;
aoa = strucdata(:,1) ;
cl = strucdata(:,2) ;
cd = strucdata(:,3) ;
cm = strucdata(:,4) ;
end
end
Loading
Loading