SlideShare a Scribd company logo
1 of 18
Download to read offline
MHD simulations with
Open Source software*
2 February 2017, Riga
* Elmer + OpenFOAM coupler
Multiphysics software like
or
but without license fees
Efficient coupling b/w
● Electromagnetics
● Free surface fluids
● Heat transfer
Extra
● Solidification
● Melting
2
Motivation
3
Our requirements
● 3D, time-dependent
● Complex A−V magnetic vector potential formulation
● High Reynolds turbulence models
● Volume of Fluid (VOF) for free surface
● Conductivity and viscosity dependence on temperature
● Complex geometries, multi-regions
● MPI parallelization with good scaling
4
Existing codes
FEM FVM
getDP OpenFOAM
Elmer SU2
Best for
Electromagnetics (EM)
Best for
Fluid dynamics (FD)
5
No one code solves our problem
.., but two codes coupled together can!
Elmer + OpenFOAM
● Both can simulate real stuff
● Straight-forward mesh interpolation
● Common pre/post processing (Salome, Paraview)
● Efficient, parallel coupling is very feasible
Elmer by CSC (Finland)
6
+ Multiphysics out-of-the-box
+ Extensive documentation and forum
+ Active, responsive developers
+ 40+ solvers, 400+ tests
+ Flexible meshes (tetra, pyramids, wedges, hexa)
+ Meshes from Salome (.unv)
+ Results to Paraview (.vtu)
- Complex code (Fortran), steep learning curve
Notable use cases for Elmer
7
● Electromagnetics
● Structural mechanics
● Ice sheet modelling
wikipedia.org
Credit F. Gillet-Chaulet
OpenFOAM.org
This slide is intentionally left blank
9
Elmer OpenFOAM
Two-way coupling
File based
● SLOW and does not SCALE on parallel computers
MPI based
● Both codes already use MPI for parallelization
● Probably the most EFFICIENT coupling solution
10
MPI - Message Passing Interface
Elmer
(2 processes)
OpenFOAM
(2 processes)
Run both codes simultaneously
mpirun -n 2 Elmer : -n 2 OpenFOAM
“application that
starts other
applications in
parallel”
MPI_SEND(
data,
type,
size,
to whom)
MPI_RECV(
data,
type,
size,
from whom)
11
Interpolation between meshes
Efficient interpolation between parallel meshes is critical
● EM domain ≥ FD domain
● EM mesh coarser than FD mesh
Elmer => OF (≥1st order accuracy)
● Interpolation matrix, uses basis functions
OF => Elmer (0th order accuracy)
● Saves OF cell numbers for found Elmer nodes
12
Adaptive coupling interval
● FD require smaller Δt than EM
● In steady regime no need to solve EM
● For low Re one OF t-step computes 5-10 times faster
Example: for fluid ratio α=[0,1] we can use condition
max(abs(αold
-α))>0.2
to find out whether surface has changed significantly
enough to call Elmer and update EM fields
13
Relatively easy to set-up
Coupler consists of
● 2 OpenFOAM libraries
● 2 Elmer libraries
These libs take care of MPI communication
User specifies which variables to send/recv
User prepares simulation and runs it
Video (14min)
14
2D cold crucible
Air
Coils
Melt
Elmer OpenFOAM
OpenFOAM
α - fluid fraction [0,1]
T - temperature
σ(α,T*) - electric conductivity
Elmer
JxB - Lorentz force
P* - Joule heating
15
Variables
Interpolated and
communicated
variables
* Not implemented yet
16
17
Conclusions
Elmer + OpenFOAM coupler
● Based on MPI, low level
● Presumably good parallel scaling
● Basic tests for 2D/3D free surface MHD done
● It can be used for other Elmer/OpenFOAM solvers
TODO: Joule heating P, parametric σ(α,T), melting, …
Q: Where else it could be useful?
Simulation video
Thank you!
juris.vencels@gmail.com
Elmer + OpenFOAM coupler
Laboratory for mathematical modelling of
environmental and technological processes
University of Latvia
https://github.com/jvencels/OpenFOAM_Elmer

More Related Content

Viewers also liked

Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0
Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0
Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0ARPIT SINGHAL
 
Customization of LES turbulence model in OpenFOAM
Customization of LES turbulence	 model in OpenFOAMCustomization of LES turbulence	 model in OpenFOAM
Customization of LES turbulence model in OpenFOAMmmer547
 
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』Fumiya Nozaki
 
OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差takuyayamamoto1800
 
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)takuyayamamoto1800
 
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-Fumiya Nozaki
 
OpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能についてOpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能についてFumiya Nozaki
 
A first order hyperbolic framework for large strain computational computation...
A first order hyperbolic framework for large strain computational computation...A first order hyperbolic framework for large strain computational computation...
A first order hyperbolic framework for large strain computational computation...Jibran Haider
 
OpenFOAM Programming Tips
OpenFOAM Programming TipsOpenFOAM Programming Tips
OpenFOAM Programming TipsFumiya Nozaki
 
OpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズOpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズmmer547
 
OpenFOAMの壁関数
OpenFOAMの壁関数OpenFOAMの壁関数
OpenFOAMの壁関数Fumiya Nozaki
 
Boundary Conditions in OpenFOAM
Boundary Conditions in OpenFOAMBoundary Conditions in OpenFOAM
Boundary Conditions in OpenFOAMFumiya Nozaki
 

Viewers also liked (14)

CFD - OpenFOAM
CFD - OpenFOAMCFD - OpenFOAM
CFD - OpenFOAM
 
Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0
Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0
Tutorial to set up a case for chtMultiRegionFoam in OpenFOAM 2.0.0
 
Customization of LES turbulence model in OpenFOAM
Customization of LES turbulence	 model in OpenFOAMCustomization of LES turbulence	 model in OpenFOAM
Customization of LES turbulence model in OpenFOAM
 
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
OpenFOAM v2.3.0のチュートリアル 『oscillatingInletACMI2D』
 
OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差OpenFOAMのinterfoamによる誤差
OpenFOAMのinterfoamによる誤差
 
Avinash_PPT
Avinash_PPTAvinash_PPT
Avinash_PPT
 
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
Setting and Usage of OpenFOAM multiphase solver (S-CLSVOF)
 
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
OpenFOAM -回転領域を含む流体計算 (Rotating Geometry)-
 
OpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能についてOpenFOAM の Function Object 機能について
OpenFOAM の Function Object 機能について
 
A first order hyperbolic framework for large strain computational computation...
A first order hyperbolic framework for large strain computational computation...A first order hyperbolic framework for large strain computational computation...
A first order hyperbolic framework for large strain computational computation...
 
OpenFOAM Programming Tips
OpenFOAM Programming TipsOpenFOAM Programming Tips
OpenFOAM Programming Tips
 
OpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズOpenFOAM LES乱流モデルカスタマイズ
OpenFOAM LES乱流モデルカスタマイズ
 
OpenFOAMの壁関数
OpenFOAMの壁関数OpenFOAMの壁関数
OpenFOAMの壁関数
 
Boundary Conditions in OpenFOAM
Boundary Conditions in OpenFOAMBoundary Conditions in OpenFOAM
Boundary Conditions in OpenFOAM
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 

MHD simulations with Open Source software - Elmer and OpenFOAM coupler

  • 1. MHD simulations with Open Source software* 2 February 2017, Riga * Elmer + OpenFOAM coupler
  • 2. Multiphysics software like or but without license fees Efficient coupling b/w ● Electromagnetics ● Free surface fluids ● Heat transfer Extra ● Solidification ● Melting 2 Motivation
  • 3. 3 Our requirements ● 3D, time-dependent ● Complex A−V magnetic vector potential formulation ● High Reynolds turbulence models ● Volume of Fluid (VOF) for free surface ● Conductivity and viscosity dependence on temperature ● Complex geometries, multi-regions ● MPI parallelization with good scaling
  • 4. 4 Existing codes FEM FVM getDP OpenFOAM Elmer SU2 Best for Electromagnetics (EM) Best for Fluid dynamics (FD)
  • 5. 5 No one code solves our problem .., but two codes coupled together can! Elmer + OpenFOAM ● Both can simulate real stuff ● Straight-forward mesh interpolation ● Common pre/post processing (Salome, Paraview) ● Efficient, parallel coupling is very feasible
  • 6. Elmer by CSC (Finland) 6 + Multiphysics out-of-the-box + Extensive documentation and forum + Active, responsive developers + 40+ solvers, 400+ tests + Flexible meshes (tetra, pyramids, wedges, hexa) + Meshes from Salome (.unv) + Results to Paraview (.vtu) - Complex code (Fortran), steep learning curve
  • 7. Notable use cases for Elmer 7 ● Electromagnetics ● Structural mechanics ● Ice sheet modelling wikipedia.org Credit F. Gillet-Chaulet
  • 8. OpenFOAM.org This slide is intentionally left blank
  • 9. 9 Elmer OpenFOAM Two-way coupling File based ● SLOW and does not SCALE on parallel computers MPI based ● Both codes already use MPI for parallelization ● Probably the most EFFICIENT coupling solution
  • 10. 10 MPI - Message Passing Interface Elmer (2 processes) OpenFOAM (2 processes) Run both codes simultaneously mpirun -n 2 Elmer : -n 2 OpenFOAM “application that starts other applications in parallel” MPI_SEND( data, type, size, to whom) MPI_RECV( data, type, size, from whom)
  • 11. 11 Interpolation between meshes Efficient interpolation between parallel meshes is critical ● EM domain ≥ FD domain ● EM mesh coarser than FD mesh Elmer => OF (≥1st order accuracy) ● Interpolation matrix, uses basis functions OF => Elmer (0th order accuracy) ● Saves OF cell numbers for found Elmer nodes
  • 12. 12 Adaptive coupling interval ● FD require smaller Δt than EM ● In steady regime no need to solve EM ● For low Re one OF t-step computes 5-10 times faster Example: for fluid ratio α=[0,1] we can use condition max(abs(αold -α))>0.2 to find out whether surface has changed significantly enough to call Elmer and update EM fields
  • 13. 13 Relatively easy to set-up Coupler consists of ● 2 OpenFOAM libraries ● 2 Elmer libraries These libs take care of MPI communication User specifies which variables to send/recv User prepares simulation and runs it Video (14min)
  • 15. OpenFOAM α - fluid fraction [0,1] T - temperature σ(α,T*) - electric conductivity Elmer JxB - Lorentz force P* - Joule heating 15 Variables Interpolated and communicated variables * Not implemented yet
  • 16. 16
  • 17. 17 Conclusions Elmer + OpenFOAM coupler ● Based on MPI, low level ● Presumably good parallel scaling ● Basic tests for 2D/3D free surface MHD done ● It can be used for other Elmer/OpenFOAM solvers TODO: Joule heating P, parametric σ(α,T), melting, … Q: Where else it could be useful? Simulation video
  • 18. Thank you! juris.vencels@gmail.com Elmer + OpenFOAM coupler Laboratory for mathematical modelling of environmental and technological processes University of Latvia https://github.com/jvencels/OpenFOAM_Elmer