Group { Cond1 = Region[101]; Cond2 = Region[111]; Ground = Region[120]; Microstrip = Region[121]; SurfInf = Region[130]; Vol_Ele = Region[ {Cond1, Cond2} ]; Sur_Neu_Ele = Region[ {} ]; Sur_Electrodes_Ele = Region [ {Ground, Microstrip} ]; } /* A number of ONELAB parameters are defined to provide model parameters or model options interactively. */ MicrostripTypeBC = DefineNumber[0, Name "1Microstrip excitation/Type", Choices{0="Fixed voltage", 1="Fixed current"}] ; MicrostripValueBC = DefineNumber[1e-3, Name "1Microstrip excitation/Value"] ; DisplayGlobalBF = DefineNumber[0, Name "3Options/Display global basis functions", Choices {0,1} ] ; OverwriteOutput = DefineNumber[1, Name "3Options/Overwrite output.txt file", Choices {0,1} ] ; Function { sigma[Cond1] = 5.87e7; // copper sigma[Cond2] = 5.87e7/1000; // copper } Constraint { { Name Dirichlet_Ele; Type Assign; Case { { Region SurfInf; Value 0; } } } { Name SetGlobalPotential; Type Assign; Case { { Region Ground; Value 0; } If(MicrostripTypeBC == 0) { Region Microstrip; Value MicrostripValueBC; } EndIf } } { Name SetArmatureCurrent; Type Assign; Case { If(MicrostripTypeBC == 1) { Region Microstrip; Value MicrostripValueBC; } EndIf } } } Group{ Dom_Hgrad_v_Ele = Region[ {Vol_Ele, Sur_Neu_Ele, Sur_Electrodes_Ele} ]; } FunctionSpace { { Name Hgrad_v_Ele; Type Form0; BasisFunction { { Name sn; NameOfCoef vn; Function BF_Node; Support Dom_Hgrad_v_Ele; Entity NodesOf[ All, Not Sur_Electrodes_Ele ]; } { Name sf; NameOfCoef vf; Function BF_GroupOfNodes; Support Dom_Hgrad_v_Ele; Entity GroupsOfNodesOf[ Sur_Electrodes_Ele ]; } } GlobalQuantity { { Name GlobalPotential; Type AliasOf ; NameOfCoef vf; } { Name ArmatureCurrent ; Type AssociatedWith; NameOfCoef vf; } } Constraint { { NameOfCoef vn; EntityType NodesOf; NameOfConstraint Dirichlet_Ele; } { NameOfCoef GlobalPotential; EntityType GroupsOfNodesOf; NameOfConstraint SetGlobalPotential; } { NameOfCoef ArmatureCurrent; EntityType GroupsOfNodesOf; NameOfConstraint SetArmatureCurrent; } } // Subspace definition only needed to display BF_electrode in PostProcessing SubSpace { { Name vf; NameOfBasisFunction sf; } } } } Jacobian { { Name Vol ; Case { { Region All ; Jacobian Vol ; } } } } Integration { { Name Int ; Case { {Type Gauss ; Case { { GeoElement Triangle ; NumberOfPoints 4 ; } { GeoElement Quadrangle ; NumberOfPoints 4 ; } } } } } } Formulation { { Name Electrokinetics_v; Type FemEquation; Quantity { { Name v; Type Local; NameOfSpace Hgrad_v_Ele; } { Name U; Type Global; NameOfSpace Hgrad_v_Ele [GlobalPotential]; } { Name I; Type Global; NameOfSpace Hgrad_v_Ele [ArmatureCurrent]; } // next line only needed to display the BF_electrode in PostProcessing { Name vf; Type Local; NameOfSpace Hgrad_v_Ele [vf]; } } Equation { Integral { [ sigma[] * Dof{d v} , {d v} ]; In Vol_Ele; Jacobian Vol; Integration Int; } GlobalTerm { [ -Dof{I} , {U} ]; In Sur_Electrodes_Ele; } } } } Resolution { { Name EleKin_v; System { { Name Sys_Ele; NameOfFormulation Electrokinetics_v; } } Operation { Generate[Sys_Ele]; Solve[Sys_Ele]; SaveSolution[Sys_Ele]; Print[Sys_Ele]; } } } PostProcessing { { Name EleKin_v; NameOfFormulation Electrokinetics_v; Quantity { { Name v; Value { Term { [ {v} ]; In Vol_Ele; Jacobian Vol; } } } { Name e; Value { Term { [ -{d v} ]; In Vol_Ele; Jacobian Vol; } } } { Name j; Value { Term { [ -sigma[] * {d v} ]; In Vol_Ele; Jacobian Vol; } } } { Name I; Value { Term { [ {I} ]; In Sur_Electrodes_Ele; } } } { Name U; Value { Term { [ {U} ]; In Sur_Electrodes_Ele; } } } { Name R; Value { Term { [ {U}/{I} ]; In Sur_Electrodes_Ele; } } } { Name BFGround; Value { Term { [ BF{vf} ]; In Dom_Hgrad_v_Ele; SubRegion Ground; Jacobian Vol; } } } { Name BFMicrostrip; Value { Term { [ BF{vf} ]; In Dom_Hgrad_v_Ele; SubRegion Microstrip; Jacobian Vol; } } } } } } PostOperation { { Name Map; NameOfPostProcessing EleKin_v; Operation { If( DisplayGlobalBF ) Print[ BFGround, OnElementsOf Dom_Hgrad_v_Ele, File "BFGround.pos" ]; Echo[ StrCat["l=PostProcessing.NbViews-1;", "View[l].IntervalsType = 1;", "View[l].NbIso = 40;", "View[l].ShowElement = 1;"], File "BFGround.opt", LastTimeStepOnly] ; Print[ BFMicrostrip, OnElementsOf Dom_Hgrad_v_Ele, File "BFMicrostrip.pos" ]; Echo[ StrCat["l=PostProcessing.NbViews-1;", "View[l].IntervalsType = 1;", "View[l].NbIso = 40;", "View[l].ShowElement = 1;"], File "BFMicrostrip.opt", LastTimeStepOnly] ; EndIf Print[ v, OnElementsOf Dom_Hgrad_v_Ele, File "v.pos" ]; Print[ j, OnElementsOf Vol_Ele, File "j.pos" ]; Echo[ StrCat["l=PostProcessing.NbViews-1;", "View[l].IntervalsType = 3;", "View[l].NbIso = 40;"], File "v.opt", LastTimeStepOnly] ; If(OverwriteOutput) DeleteFile[ "output.txt" ]; EndIf Echo[ "Microstrip current [A]:", Format Table, File > "output.txt"] ; Print[ I, OnRegion Microstrip, File > "output.txt", Color "AliceBlue", Format Table, SendToServer "Output/Microstrip/Current [A]" ]; Echo[ "Microstrip potential [V]:", Format Table, File > "output.txt"] ; Print[ U, OnRegion Microstrip, File > "output.txt", Color "AliceBlue", Format Table, SendToServer "Output/Microstrip/Potential [V]" ]; Echo[ "Ground charge [C]:", Format Table, File > "output.txt"] ; Print[ I, OnRegion Ground, File > "output.txt", Color "AliceBlue", Format Table, SendToServer "Output/Ground/Current [A]" ]; Echo[ "Microstrip capacitance [F]:", Format Table, File > "output.txt"] ; Print[ R, OnRegion Microstrip, File > "output.txt", Color "AliceBlue", Format Table, SendToServer "Output/Global/Resistance [Ohms]" ]; } } }