| 1 | %FRICTIONWEERTMAN class definition
|
|---|
| 2 | %
|
|---|
| 3 | % Usage:
|
|---|
| 4 | % friction=frictionhydro();
|
|---|
| 5 |
|
|---|
| 6 | classdef frictionhydro
|
|---|
| 7 | properties (SetAccess=public)
|
|---|
| 8 | Coupling = 0;
|
|---|
| 9 | q = NaN;
|
|---|
| 10 | C = NaN;
|
|---|
| 11 | As = NaN;
|
|---|
| 12 | effective_pressure = NaN;
|
|---|
| 13 | end
|
|---|
| 14 | methods
|
|---|
| 15 | function self = frictionhydro(varargin) % {{{
|
|---|
| 16 | switch nargin
|
|---|
| 17 | case 0
|
|---|
| 18 | self=setdefaultparameters(self);
|
|---|
| 19 | otherwise
|
|---|
| 20 | error('constructor not supported');
|
|---|
| 21 | end
|
|---|
| 22 | end % }}}
|
|---|
| 23 | function self = setdefaultparameters(self) % {{{
|
|---|
| 24 |
|
|---|
| 25 | end % }}}
|
|---|
| 26 | function md = checkconsistency(self,md,solution,analyses) % {{{
|
|---|
| 27 |
|
|---|
| 28 | %Early return
|
|---|
| 29 | if ~ismember(StressbalanceAnalysisEnum(),analyses) & ~ismember(ThermalAnalysisEnum(),analyses), return; end
|
|---|
| 30 | md = checkfield(md,'fieldname','friction.Coupling','numel',[1],'values',[0 1]);
|
|---|
| 31 | md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
|
|---|
| 32 | md = checkfield(md,'fieldname','friction.C','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
|
|---|
| 33 | md = checkfield(md,'fieldname','friction.As','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
|
|---|
| 34 | if self.Coupling==0,
|
|---|
| 35 | md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
|
|---|
| 36 | end
|
|---|
| 37 | end % }}}
|
|---|
| 38 | function self = extrude(self,md) % {{{
|
|---|
| 39 | self.q=project3d(md,'vector',self.q,'type','element');
|
|---|
| 40 | self.C=project3d(md,'vector',self.C,'type','element');
|
|---|
| 41 | self.As=project3d(md,'vector',self.As,'type','element');
|
|---|
| 42 | if self.Coupling==0,
|
|---|
| 43 | self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
|
|---|
| 44 | end
|
|---|
| 45 | end % }}}
|
|---|
| 46 | function disp(self) % {{{
|
|---|
| 47 | disp(sprintf('Effective Pressure based friction law described in Gagliardini 2007'));
|
|---|
| 48 | fielddisplay(self,'Coupling','Coupling flag, 1 for coupling and 0 for forcing');
|
|---|
| 49 | fielddisplay(self,'q','friction law exponent q>=1');
|
|---|
| 50 | fielddisplay(self,'C','friction law max value [SI]');
|
|---|
| 51 | fielddisplay(self,'As','Sliding Parameter without cavitation [m Pa^-n s^-1]');
|
|---|
| 52 | fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
|
|---|
| 53 | end % }}}
|
|---|
| 54 | function marshall(self,md,fid) % {{{
|
|---|
| 55 | WriteData(fid,'enum',FrictionLawEnum,'data',3,'format','Integer');
|
|---|
| 56 | WriteData(fid,'class','friction','object',self,'fieldname','Coupling','format','Integer');
|
|---|
| 57 | WriteData(fid,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);
|
|---|
| 58 | WriteData(fid,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',2);
|
|---|
| 59 | WriteData(fid,'class','friction','object',self,'fieldname','As','format','DoubleMat','mattype',2);
|
|---|
| 60 | if self.Coupling==0,
|
|---|
| 61 | WriteData(fid,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
|
|---|
| 62 | end
|
|---|
| 63 | end % }}}
|
|---|
| 64 | end
|
|---|
| 65 | end
|
|---|