|
[Sponsors] |
How to write a solver for nonlinear equations |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 6, 2019, 20:59 |
How to write a solver for nonlinear equations
|
#1 |
Senior Member
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10 |
Hello,
I am trying to solve the emden-fowler equation: T*laplace(T)=x by writing an openfoam solver (I only care about the 1D problem, so I am taking T as a scalar). I have some code that can solve div(T)=x using fvOptions - that part is not hard. However, when I add in multiplication by T, it complies, but the solver crashes. I am not sure what is wrong: Code:
fvScalarMatrix TEqn ( T*fvm::laplacian(DT, T) == correctDim*fvOptions(T) ); fvOptions.constrain(TEqn); TEqn.solve(); fvOptions.correct(T); or if the solver is actually the problem. When I remove the fvOptions forcing term, the solver will run, but produce incorrect results. For example, if I specify dirichlet 1 boundaries on either side, the solution is f(x) = 0 with kinked boundaries, but should be f(x)=1. Any ideas? I was thinking maybe I am not treating the T*laplace(T) term correctly? Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to develop my OWN solver for Navier-Stokes equations | Abderahmane | Main CFD Forum | 1 | September 7, 2017 12:26 |
New Free Solver -- FlowEDG: A DG solver for the compressible Euler and NS equations | mavguy | Main CFD Forum | 11 | May 29, 2015 17:52 |
thobois class engineTopoChangerMesh error | Peter_600 | OpenFOAM | 4 | August 2, 2014 09:52 |
Adding two Energy Equations to Porous Solver | Filankes | OpenFOAM Programming & Development | 2 | December 3, 2013 05:20 |
free " ordinary differential equations solver" | ztdep | Main CFD Forum | 2 | March 21, 2006 01:58 |