|
[Sponsors] |
May 14, 2020, 11:38 |
Implementation a new solver in foam-extend
|
#1 |
New Member
Yujuan Luo
Join Date: Jul 2019
Posts: 21
Rep Power: 7 |
Hi all,
Now I want to implement a new solver in foam-extend-4.1. In the solver, two equations for θ1 and θ2 have to be solved. The transient term, convection term and source term are similar to expressions in other solvers, but the diffusion terms look little bit different: In the equation for θ1, the diffusion term is a*div(D1gradθ1+D2gradθ2). In the equation for θ2, the diffusion term is b*div(D1gradθ1+D2gradθ2). Now I implement these terms like follows: (1) Define a fvBlockMatrix thetaEqn. (2) Define fvScalarMatrix theta1Eqn and theta2Eqn for θ1 and θ2. For θ1, a*div(D1gradθ1) is expressed like: a*fvm::laplacian(D1,θ1), where a is a volScalarField. For θ2, it is similar. (3) thetaEqn.insertEquation(0, theta1Eqn); thetaEqn.insertEquation(1, theta2Eqn). (4) thetaEqn.insertEquationCoupling(0,1,a*fvm::laplaci an(D2,θ2)); thetaEqn.insertEquationCoupling(1,0,b*fvm::laplaci an(D1,θ1)). (5) thetaEqn.solve(); However, the simulation just crashed after some time. Do you have any suggestions on how to implementing this diffusion term? Thanks a lot! Best regards, Yujuan |
|
May 18, 2020, 13:04 |
|
#2 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 |
Hey Yujuan,
Depending on how your solver is structured (iterative solver), you can also directly embed the diffusion term linked to the "other scalar" explicitely. A combination of fvc::div and fvc::grad as you suggested should work while using fvm::laplancian for the scalar for which you are currently solving the equation. You should be able to iterate over both equations until convergence is reached for both scalars. However, I do not know how this will affect the overall stability of the solver. If you still havn't found a solution, it could be worth trying. Good luck! RP |
|
May 19, 2020, 10:24 |
|
#3 | |
New Member
Yujuan Luo
Join Date: Jul 2019
Posts: 21
Rep Power: 7 |
Quote:
Thanks a lot for your suggestions. I'll have a try to use fvc::div(fvc::grad). |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using createPatch and cyclicAMI in FOAM Extend to create periodicbox | manuc | OpenFOAM Running, Solving & CFD | 1 | April 12, 2022 12:36 |
[foam-extend.org] Installing Foam Extend 4.0 on Linux Mint | andysuth | OpenFOAM Installation | 1 | May 11, 2019 09:37 |
probe Locations error in the dynamicMesh foam extend 4.0 | vahidreza lotfi | OpenFOAM Post-Processing | 2 | August 22, 2018 11:30 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 02:27 |