Skip to content
Snippets Groups Projects
Commit 873f29c5 authored by sp89hili's avatar sp89hili
Browse files

Pu_add method.C.k_vh_factor and method.C.pressureDistribution, remove...

Pu_add method.C.k_vh_factor and method.C.pressureDistribution, remove method.C.Schneider_k_vh for outside area and unloadedRE, hide most properties and methods of BearImpMethods for easier use
parent 2c5214f0
No related branches found
No related tags found
No related merge requests found
......@@ -62,16 +62,27 @@ for posBall_conductive=1:L.numberOfConductiveBalls
tempR_li = G.R_li(ballMaterialInd(posBall_conductive));
tempR_la = G.R_la(ballMaterialInd(posBall_conductive));
tempR_RE = G.R_RE(ballMaterialInd(posBall_conductive));
if any(C.method.outsideArea == {'Schneider_k_c','Schneider_k_vh'})
if any([C.method.outsideArea == {'Schneider_k_c','Schneider_k_vh'} C.method.pressureDistribution == 'on'])
tempG = H.G(:,:,posBall_conductive);
tempW = H.W(:,:,posBall_conductive);
end
contactInd=B.contactInd(posBall_conductive,:);
C.rhoRatio = 1 + (9.73e-3 .* (temp_p.*0.101972e-6).^0.75) ./ (T.nu_38.*1e6).^0.0385;
C.epsilon_primeOil = (S.epsilon_Oel + 2 + 2*(S.epsilon_Oel-1).*C.rhoRatio) ./ (S.epsilon_Oel + 2 - (S.epsilon_Oel-1).*C.rhoRatio);
C.C_Hertz(:,contactInd,posBall_conductive) = obj.epsilon_0 .* C.epsilon_primeOil(:,contactInd) .* temp_A(:,contactInd) ./ temp_h_0(:,contactInd);
C.rhoRatio = @(p) 1 + (9.73e-3 .* (p.*0.101972e-6).^0.75) ./ (T.nu_38.*1e6).^0.0385;
C.epsilon_primeOil = @(p) (S.epsilon_Oel + 2 + 2*(S.epsilon_Oel-1).*C.rhoRatio(p)) ./ (S.epsilon_Oel + 2 - (S.epsilon_Oel-1).*C.rhoRatio(p));
if C.method.pressureDistribution == 'on'
for io = 1:size(temp_a,1)
for singleContInd = find(contactInd)
p_max = 3/2*temp_p(io,singleContInd); % Hamrock/Dowson (3.6), S. 71
p_fcn = @(x,y) p_max .* sqrt(1-(x./temp_a(io,singleContInd)).^2-(y./temp_b(io,singleContInd)).^2);
epsByH_fcn = @(x,y) 4 * obj.epsilon_0 .* C.epsilon_primeOil(p_fcn(x,y)) ./ temp_h_0(io,singleContInd);
C.C_Hertz(io,singleContInd,posBall_conductive) = integral2(epsByH_fcn,0,temp_a(io,singleContInd),0,@(x) temp_b(io,singleContInd).*sqrt(1-(x./temp_a(io,singleContInd)).^2));
end
end
else
C.C_Hertz(:,contactInd,posBall_conductive) = obj.epsilon_0 .* C.epsilon_primeOil(temp_p(:,contactInd)) .* temp_A(:,contactInd) ./ temp_h_0(:,contactInd);
end
R_el_single(:,contactInd,posBall_conductive) = 1./C.k_R .* S.rho_el .* temp_h_0(:,contactInd) ./ temp_A(:,contactInd);
C.DeltaR_i(contactInd) = tempR_li - tempR_RE - temp_h_0(1,contactInd);
......@@ -120,11 +131,7 @@ for posBall_conductive=1:L.numberOfConductiveBalls
stateOfTheArt(find(contactInd==1))
case 'Schneider_k_c'
C.k_c = 9.5923 * H.U.^0.3305 .* tempG.^0.3413 .* tempW.^(-0.3342) .* G.k.^0.1391;
%C.C_Hertz(:,contactInd,posBall_conductive) = k_c(:,contactInd,posBall_conductive) .* C.C_Hertz(:,contactInd,posBall_conductive);
C.C_out(:,contactInd,posBall_conductive) = (C.k_c (:,contactInd,posBall_conductive)-1) .* C.C_Hertz(:,contactInd,posBall_conductive);
case 'Schneider_k_vh'
C.k_vh = 0.7772 * H.U.^0.0451 .* tempG.^0.1522 .* tempW.^(-0.0245) .* G.k.^(-0.0921);
C.C_out(:,contactInd,posBall_conductive) = (C.k_vh(:,contactInd,posBall_conductive)-1) .* C.C_Hertz(:,contactInd,posBall_conductive);
case 'Leander_Parallel'
leander_parallel(B.contactInd)
case 'Leander_Radial'
......@@ -140,7 +147,12 @@ for posBall_conductive=1:L.numberOfConductiveBalls
end
end
C_el_single(:,:,posBall_conductive) = C.C_Hertz(:,:,posBall_conductive) + C.C_out(:,:,posBall_conductive);
if C.method.k_vh_factor == 'on'
C.k_vh = 0.7772 * H.U.^0.0451 .* tempG.^0.1522 .* tempW.^-0.0245 .* G.k.^-0.0921;
C.C_Hertz(:,:,posBall_conductive) = C.C_Hertz(:,:,posBall_conductive) .* C.k_vh(:,:,posBall_conductive);
end
C_el_single(:,:,posBall_conductive) = C.C_Hertz(:,:,posBall_conductive) + C.C_out(:,:,posBall_conductive); %#ok<AGROW>
end
......
......@@ -9,7 +9,7 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
% pmd Berechnungstool Lagerimpedanz
% Autor: Steffen Puchtler, Julius van der Kuip
properties
properties (Hidden)
optionName
optionLevel = 1
optionChosen = 'default'
......@@ -26,7 +26,7 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
optionChanged
end
methods (Static)
methods (Static,Hidden)
function possibleOption = Possible
possibleOption.T = {'linear','Vogel'};
possibleOption.B = {'static','dynamic'};
......@@ -35,7 +35,9 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
possibleOption.H.starvationCorrection = {'on','off'};
possibleOption.H.roughnessCorrection = {'on','off'};
possibleOption.C.unloadedRE = { 'neglect','stateOfTheArt', 'Leander_Parallel','Leander_Radial','LeanderSteffen','TobiasSteffen_Kugelfläche','TobiasSteffen_Laufbahnfläche','semianalytisch3D'};
possibleOption.C.outsideArea = {'k-factor','neglect','stateOfTheArt','Schneider_k_c','Schneider_k_vh','Leander_Parallel','Leander_Radial','LeanderSteffen','TobiasSteffen_Kugelfläche','TobiasSteffen_Laufbahnfläche','semianalytisch3D'};
possibleOption.C.outsideArea = {'k-factor','neglect','stateOfTheArt','Schneider_k_c','Leander_Parallel','Leander_Radial','LeanderSteffen','TobiasSteffen_Kugelfläche','TobiasSteffen_Laufbahnfläche','semianalytisch3D'};
possibleOption.C.k_vh_factor = {'on','off'};
possibleOption.C.pressureDistribution = {'on','off'};
end
function defaultOption = Default
......@@ -48,8 +50,12 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
defaultOption.H.roughnessCorrection = 'off';
defaultOption.C.unloadedRE = 'semianalytisch3D';
defaultOption.C.outsideArea = 'semianalytisch3D';
defaultOption.C.k_vh_factor = 'off';
defaultOption.C.pressureDistribution = 'on';
end
end
methods (Static, Hidden)
function subOptionsCell = subOptionsSetWith
% Gibt an, welche suboptions geändert werden sollen, wenn versucht
% wird, eine Option mit Unteroptionen direkt zu setzen.
......@@ -109,7 +115,7 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
end
end
methods
methods (Hidden)
function charOut = char(obj)
if strcmp(obj.optionChosen,'default') && ~obj.hasSubSubOptions
charOut = obj.defaultOption;
......@@ -173,43 +179,6 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
diffs = unique(diffs);
end
function possibleSubOptions = get.possibleSubOptions (obj)
if obj.optionLevel == 1
possibleSubOptions = fieldnames(BearImpOptions.Possible)';
elseif obj.optionLevel == 2
if isstruct(BearImpOptions.Possible.(char(obj.optionName)))
possibleSubOptions = fieldnames(BearImpOptions.Possible.(char(obj.optionName)))';
elseif iscell(BearImpOptions.Possible.(char(obj.optionName)))
possibleSubOptions = BearImpOptions.Possible.(char(obj.optionName));
end
elseif obj.optionLevel == 3
if obj.hasSubSubOptions
possibleSubOptions = fieldnames(BearImpOptions.Possible.(obj.parent.optionName))';
else
possibleSubOptions = BearImpOptions.Possible.(obj.parent.optionName).(obj.optionName);
end
elseif isstruct(BearImpOptions.Possible.(obj.parent.optionName)) && ismember(obj.optionName,fieldnames(BearImpOptions.Possible.(obj.parent.optionName)))
else
possibleSubOptions = {};
end
end
function hasSubSubOptions = get.hasSubSubOptions(obj)
switch obj.optionLevel
case 1
hasSubSubOptions = true;
case 2
hasSubSubOptions = isstruct(BearImpOptions.Possible.(obj.optionName));
case 3
if ~isstruct(BearImpOptions.Possible.(obj.parent.optionName))
hasSubSubOptions = false;
else
hasSubSubOptions = isstruct(BearImpOptions.Possible.(obj.parent.optionName).(obj.optionName));
end
end
end
function set_optionChosen(obj,subOptionName,optionChoice)
objBefore = obj.copy;
if ischar(optionChoice) || isstring(optionChoice)
......@@ -329,4 +298,43 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m
end
end
end
methods % get functions
function possibleSubOptions = get.possibleSubOptions (obj)
if obj.optionLevel == 1
possibleSubOptions = fieldnames(BearImpOptions.Possible)';
elseif obj.optionLevel == 2
if isstruct(BearImpOptions.Possible.(char(obj.optionName)))
possibleSubOptions = fieldnames(BearImpOptions.Possible.(char(obj.optionName)))';
elseif iscell(BearImpOptions.Possible.(char(obj.optionName)))
possibleSubOptions = BearImpOptions.Possible.(char(obj.optionName));
end
elseif obj.optionLevel == 3
if obj.hasSubSubOptions
possibleSubOptions = fieldnames(BearImpOptions.Possible.(obj.parent.optionName))';
else
possibleSubOptions = BearImpOptions.Possible.(obj.parent.optionName).(obj.optionName);
end
elseif isstruct(BearImpOptions.Possible.(obj.parent.optionName)) && ismember(obj.optionName,fieldnames(BearImpOptions.Possible.(obj.parent.optionName)))
else
possibleSubOptions = {};
end
end
function hasSubSubOptions = get.hasSubSubOptions(obj)
switch obj.optionLevel
case 1
hasSubSubOptions = true;
case 2
hasSubSubOptions = isstruct(BearImpOptions.Possible.(obj.optionName));
case 3
if ~isstruct(BearImpOptions.Possible.(obj.parent.optionName))
hasSubSubOptions = false;
else
hasSubSubOptions = isstruct(BearImpOptions.Possible.(obj.parent.optionName).(obj.optionName));
end
end
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment