git commit 10fdcf57b7
It seams I was to fast. I fixed the fix ...
Would you double check HoWil?
Moderator: bernd
This is basically my fault... will check it out and compile!bernd wrote: ↑Thu May 21, 2020 3:00 pmgit commit 10fdcf57b7
It seams I was to fast. I fixed the fix ...
Would you double check HoWil?
That's neat idea! It's probably not that different since E=CU^2/2 and F=dU/dx. One would need multiple computations to get something like a force matrix. With one simulation you can get forces acting on nodes and group of nodes i.e boundaries.HoWil wrote: ↑Thu May 21, 2020 10:33 amWhy not using something similar to the calculation of the capacitance where I can specify different 'ports' and the capacitance is given between all different pairs of ports. I am sure the mathematics behind the calculation of the capacitance and the forces is completely different but It is much simpler for the user to specify a boundary and get the total force on this boundary without running a integration on the nodes of the boundary afterwards.
Code: Select all
Check Keywords Warn
Header
Mesh DB "."
End
Solver 1
Bubbles = Logical False
Calculate Capacitance Matrix = Logical True
Calculate Electric Energy = Logical False
Calculate Electric Field = Logical False
Calculate Surface Charge = Logical False
Displace mesh = Logical False
Equation = String "Stat Elec Solver"
Exec Solver = String "Always"
Linear System Abort Not Converged = Logical False
Linear System Convergence Tolerance = Real 1e-06
Linear System Iterative Method = String "BiCGStab"
Linear System Max Iterations = Integer 500
Linear System Precondition Recompute = Integer 1
Linear System Preconditioning = String "ILU0"
Linear System Residual Output = Integer 1
Linear System Solver = String "Iterative"
Optimize Bandwidth = Logical True
Procedure = File "StatElecSolve" "StatElecSolver"
Stabilize = Logical True
Steady State Convergence Tolerance = Real 1e-06
Variable = String "Potential"
Variable DOFs = Integer 1
End
Simulation
BDF Order = Integer 1
Coordinate Mapping(3) = Integer 1 2 3
Coordinate System = String "Cartesian 3D"
Output Intervals = Integer 1
Simulation Type = String "Steady state"
Steady State Max Iterations = Integer 1
Steady State Min Iterations = Integer 0
Timestepping Method = String "BDF"
Use Mesh Names = Logical True
End
Constants
Permittivity Of Vacuum = Real 8.8542e-21
End
Body 1
Equation = Integer 1
Material = Integer 1
Name = String "Solid1"
End
Material 1
Relative Permittivity = Real 1.0
End
Equation 1
Active Solvers(2) = Integer 1 2
End
Solver 2
Equation = String "ResultOutput"
Exec Solver = String "After simulation"
Output File Name = File "case"
Procedure = File "ResultOutputSolve" "ResultOutputSolver"
Vtu Format = Logical True
End
Boundary Condition 1
Capacitance Body = Integer 1
Name = String "Face6"
Potential = Real 2000000.0
End
Boundary Condition 2
Capacitance Body = Integer 2
Name = String "Face5"
Potential = Real -1000000.0
End
Code: Select all
Check Keywords Warn
Header
Mesh DB "."
End
Solver 1
Bubbles = Logical False
Calculate Capacitance Matrix = Logical False
Calculate Electric Energy = Logical False
Calculate Electric Field = Logical False
Calculate Surface Charge = Logical False
Displace mesh = Logical False
Equation = String "Stat Elec Solver"
Exec Solver = String "Always"
Linear System Abort Not Converged = Logical False
Linear System Convergence Tolerance = Real 1e-06
Linear System Iterative Method = String "BiCGStab"
Linear System Max Iterations = Integer 500
Linear System Precondition Recompute = Integer 1
Linear System Preconditioning = String "ILU0"
Linear System Residual Output = Integer 1
Linear System Solver = String "Iterative"
Optimize Bandwidth = Logical True
Procedure = File "StatElecSolve" "StatElecSolver"
Stabilize = Logical True
Steady State Convergence Tolerance = Real 1e-06
Variable = String "Potential"
Variable DOFs = Integer 1
End
Simulation
BDF Order = Integer 1
Coordinate Mapping(3) = Integer 1 2 3
Coordinate System = String "Cartesian 3D"
Output Intervals = Integer 1
Simulation Type = String "Steady state"
Steady State Max Iterations = Integer 1
Steady State Min Iterations = Integer 0
Timestepping Method = String "BDF"
Use Mesh Names = Logical True
End
Constants
Permittivity Of Vacuum = Real 8.8542e-21
End
Body 1
Equation = Integer 1
Material = Integer 1
Name = String "Solid1"
End
Material 1
Relative Permittivity = Real 1.0
End
Equation 1
Active Solvers(2) = Integer 1 2
End
Solver 2
Equation = String "ResultOutput"
Exec Solver = String "After simulation"
Output File Name = File "case"
Procedure = File "ResultOutputSolve" "ResultOutputSolver"
Vtu Format = Logical True
End
Boundary Condition 1
Capacitance Body = Integer 1
Name = String "Face6"
Potential = Real 2000000.0
End
Boundary Condition 2
Capacitance Body = Integer 2
Name = String "Face5"
Potential = Real -1000000.0
End
Peter, should the potential look this way when the calculation of the capacitance matrix is switched on?raback wrote: Ping
If I select to calculate the capacitance matrix, than it is not possible to calculate also electric forces, right?raback wrote: ↑Mon May 25, 2020 10:54 amHi
Capacitance matrix involves a special kind of automated procedure. If you need to define N x N capacitance matrix the voltage is varied N times so that it is one in the i:th capacitor (i=1,2,...,N), and zero on others. Then when computing the induced charge for all combinations we have N x N charges from which the capacitance matrix may be solved from.
So yes, the capacitance matrix will visualize the last combination in the above process and basically it is automated for your.
Why use 0/1 potentials? The mere concept of capacitance assumes linear equations so we can use the potentials arbitrarily as far as they give enough information to define the capacitance. Choosing 0/1 seems convenient.
-Peter
Code: Select all
##### Analytical calculation of the capacitence in z-direction
C = epsilon_p * epsilon_r * A/d where A is the area of the parallel plate capacitor and d is the distance between the plates.
```
import quantities as pq
print("Analytical solution for parallel plate cacacitor in F: ")
A = (0.005*0.005) * pq.m**2 # alternative: A = (0.005*0.005 - 1.5e-3*1.5e-3) * pq.m**2
d = 0.001 * pq.m
C = (8.854e-12 *(pq.F/pq.m) * 1 * (A/d) )
print(str(C.rescale(pq.F)))
```
Results in:
```
Analytical solution for parallel plate cacacitor in F:
2.2134999999999999e-13 F
```
##### Values for the capacitance computed by Elmer
```
import quantities as pq
C_mm = 2.16291E-19 * (pq.A**2 * pq.s**4 / (pq.kg * pq.mm**2))
print("Capacity in F : " + str(C_mm.rescale(pq.F)))
```
Capacity in F : 2.16291e-13 F
The the analytical an simulation results match very well but do not match the values given in the documentation!!!
Code: Select all
##### Analytical calculation of the resulting Force in z-direction for the 5mm x 5mm x 7.5mm large model!!!
See also nonGUI Tutorial page 30 (F = 1/2 * epsilon_0 * epsilon_r * (A/d^2) * Potentialdifference^2)
```
import quantities as pq
print("Analytical solution for parallel plate cacacitor in N: ")
A = (0.005*0.005) * pq.m**2 # alternative: A = (0.005*0.005 - 1.5e-3*1.5e-3) * pq.m**2
d = 0.001 * pq.m
F = (1./2. * 8.854e-12 *(pq.F/pq.m) * 1 * (A/d**2) * ( ( (1e6 * pq.V )**2)))
print(F.rescale(pq.N))
```
Results in:
```
Analytical solution for parallel plate cacacitor in N:
110.67500000000001 N
```
##### Values for the resulting Force in z-direction computed by Elmer
```
import quantities as pq
force_es = 1.030748E+05*(pq.kg*pq.mm/pq.s**2)
print("electrostatic Force in N : "+str(force_es.rescale(pq.N)))
```
Results : electrostatic Force in N : 103.07480000000001 N
The results match very well!!!
Code: Select all
OS: Ubuntu 19.10 (ubuntu:GNOME/ubuntu-wayland)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 30dcafc590fb5051d8a7ed99dce21125ad5d6439
Python version: 3.7.5
Qt version: 5.12.4
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
You can forget about them. It is just a convenient choice of units in a project long ago. Unless you're working with very small sizes no need to use non-standard units.HoWil wrote: ↑Tue May 26, 2020 8:44 pmBTW: What exactly are the'Elmer MEMS units' mentioned on page 31. There was no scaling introduce in the 'Simulation' section. I ask this because I re-build this model with the current FC-Elmer-framework and use the provided mesh from the tutorial (5mm x 5mm x 7,5mm in size) and compute the electrostatic force and the capacitance matrix.
Well, if you have just two different potentials there is not really a need to calculate capacitance matrix. I think you can get the capacitance from the electric energy automatically since E=CU^2/2. So in this case the "Capacitance matrix" machinery is an overkill since the size of the matrix is 1x1. You'll see that you get capacitance computed even without it.HoWil wrote: ↑Tue May 26, 2020 8:44 pmIf I select to calculate the capacitance matrix, than it is not possible to calculate also electric forces, right?
So, in the 'Tutorial 6 - Electrostatics' of the nonGUI examples (https://www.nic.funet.fi/index/elmer/do ... nonGUI.pdf, starting at page 28) the capacitance and the forces were not computed at one?
Code: Select all
Post File = case.vtu
But, I want to use this tutorial model as example for the new capabilities of FC-Elmer. Therefore, I need to show that the results are equal and correct