# Implementation a new solver in foam-extend

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 14, 2020, 10:38 Implementation a new solver in foam-extend #1 New Member   Yujuan Luo Join Date: Jul 2019 Posts: 13 Rep Power: 2 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, 12:04 #2 Member   Join Date: Dec 2018 Location: Darmstadt, Germany Posts: 80 Rep Power: 3 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, 09:24
#3
New Member

Yujuan Luo
Join Date: Jul 2019
Posts: 13
Rep Power: 2
Quote:
 Originally Posted by raumpolizei 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
Hi, raumpolizei

Thanks a lot for your suggestions. I'll have a try to use fvc::div(fvc::grad).

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post [foam-extend.org] Installing Foam Extend 4.0 on Linux Mint andysuth OpenFOAM Installation 1 May 11, 2019 08:37 manuc OpenFOAM Running, Solving & CFD 0 November 27, 2018 03:21 vahidreza lotfi OpenFOAM Post-Processing 2 August 22, 2018 10:30 [mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57 immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27

All times are GMT -4. The time now is 08:49.

 Contact Us - CFD Online - Privacy Statement - Top