Skip to content

Commit

Permalink
Don't require homogenization for all coils
Browse files Browse the repository at this point in the history
Also we hack coil solver such that we don't have the problem
shown in:
#460 (comment)
  • Loading branch information
ettaka committed May 6, 2024
1 parent 7899422 commit efb74f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions fem/src/modules/CoilSolver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ SUBROUTINE CoilSolver( Model,Solver,dt,TransientSimulation )
ALLOCATE( CoilIndex( Mesh % NumberOfNodes ) )
CoilIndex = 0
END IF
CYCLE
NoCoils = NoCoils + 1
IF( CoilClosed ) THEN
SelectNodes = .TRUE.
Expand Down
11 changes: 7 additions & 4 deletions fem/src/modules/MagnetoDynamics/CalcFields.F90
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ SUBROUTINE MagnetoDynamicsCalcFields(Model,Solver,dt,Transient)
CalcFluxLogical, CoilBody, PreComputedElectricPot, ImposeCircuitCurrent, &
ItoJCoeffFound, ImposeBodyForceCurrent, HasVelocity, HasAngularVelocity, &
HasLorenzVelocity, HaveAirGap, UseElementalNF, HasTensorReluctivity, &
ImposeBodyForcePotential, JouleHeatingFromCurrent, HasZirka, DoAve
ImposeBodyForcePotential, JouleHeatingFromCurrent, HasZirka, DoAve, HomogenizationModel
LOGICAL :: PiolaVersion, ElementalFields, NodalFields, RealField, pRef
LOGICAL :: CSymmetry, HasHBCurve, LorentzConductivity, HasThinLines=.FALSE., NewMaterial

Expand Down Expand Up @@ -1194,7 +1194,10 @@ SUBROUTINE MagnetoDynamicsCalcFields(Model,Solver,dt,Transient)
N_j = GetConstReal (CompParams, 'Stranded Coil N_j', Found)
IF (.NOT. Found) CALL Fatal ('MagnetoDynamicsCalcFields', 'Stranded Coil N_j not found!')

IF (HomogenizationLoss) THEN

HomogenizationModel = GetLogical(CompParams, 'Homogenization Model', Found)

IF (HomogenizationLoss .and. HomogenizationModel) THEN
BLOCK
REAL(KIND=dp) :: nu_11(n), nuim_11(n), nu_22(n), nuim_22(n)
REAL(KIND=dp) :: sigma_33(n), sigmaim_33(n)
Expand Down Expand Up @@ -1658,7 +1661,7 @@ SUBROUTINE MagnetoDynamicsCalcFields(Model,Solver,dt,Transient)
GaussPoint = j, Rdim=mudim, Rtensor=MuTensor, DummyVals = B(1,:) )
Nu(1:3,1:3) = muTensor(1:3,1:3)
w_dens = 0.5*SUM(B(1,:)*MATMUL(REAL(Nu), B(1,:)))
ELSE IF (HomogenizationLoss .AND. CoilType == 'stranded') THEN
ELSE IF (HomogenizationLoss .AND. CoilType == 'stranded' .and. HomogenizationModel) THEN
DO k=1,3
DO l=1,3
Nu(k,l) = SUM( Nu_el(k,l,1:n) * Basis(1:n) )
Expand Down Expand Up @@ -2035,7 +2038,7 @@ SUBROUTINE MagnetoDynamicsCalcFields(Model,Solver,dt,Transient)
END IF
END IF

IF ( HomogenizationLoss .AND. CoilType == 'stranded') THEN
IF ( HomogenizationLoss .AND. CoilType == 'stranded' .and. HomogenizationModel) THEN
! homogenization loss should be real part of im omega b . conj(h)/2
BLOCK
COMPLEX(KIND=dp) :: Bloc(3)=0._dp
Expand Down

0 comments on commit efb74f5

Please sign in to comment.