|
[Sponsors] |
How to construct a system of equations from discretized equations |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 15, 2021, 21:24 |
How to construct a system of equations from discretized equations
|
#1 |
Member
Jun
Join Date: Nov 2015
Posts: 57
Rep Power: 10 |
Dear Forums,
I have a problem with developing code. Though I have used OpenFOAM for several years, I know how basic codes work such as pimpleFOAM, pisoFOAM and interFOAM. However, I am really de-facto new to modify the code myself. When I find articles, I can get time discretized equations or space discretized equations. What should I do if I wanna use the formulations in discretized equations? As far as I know, discretization can be controlled at fvScheme but some expressions seem not to be achieved through fvScheme. For example, if I have time discretized equation as below, how can I formulate a system of equations? I know this is second-order time discretized equation. However, I do know how to exactly construct the system of equations as given. I really appreciate it if you give me any advice or any guide to solving this issue. Best regards, Jun |
|
June 16, 2021, 06:29 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15 |
Have a look at the programmer guide. Equations look like this
Code:
fvm::ddt(C) + fvm::div(phi,C) |
|
June 16, 2021, 20:50 |
Thank you
|
#3 |
Member
Jun
Join Date: Nov 2015
Posts: 57
Rep Power: 10 |
Dear Alleto,
First of all, thank you so much for your reply. Well, I already know how to construct matrix with fvm, fvc, and fvScheme. My problem is that whenever I encounter equations in analytic form with information about their discretization scheme, I can handle it. However, I do not know how to construct matrix from "discretized equation". Do you know how to handle for this purpose? Best regards, Jun |
|
June 17, 2021, 01:31 |
|
#4 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15 |
When you encounter a dircetized equation you have to choose the corresponding scheme in the fvschemes. There is no other easy way. You can program you scheme by your self of course.
|
|
June 18, 2021, 16:14 |
|
#5 |
Senior Member
|
Maybe like so:
int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //Construct linear solver and preconditioner only once, for re-use later fvScalarMatrix TEqn ( fvm::laplacian(k, T) ); autoPtr<fvScalarMatrix::fvSolver> solver(TEqn.solver()); solverPerformance solverPerf; for (int i=0; i<10; i++) { TEqn.source() = mesh.V() * (- su - fvc::Sp(sp, T)); solverPerf = solver->solve(); runTime++; runTime.write(); } Info<< nl; runTime.printExecutionTime(Info); Info<< "End\n" << endl; return 0; } |
|
March 28, 2024, 01:52 |
Share a very good presentation
|
#6 |
New Member
Yanjun Tong
Join Date: Jul 2020
Posts: 13
Rep Power: 5 |
||
April 23, 2024, 02:26 |
|
#7 |
New Member
Lavinia Cummerata
Join Date: Feb 2024
Posts: 4
Rep Power: 2 |
When faced with a discretized equation, you must select https://cannacraftcorner.com the appropriate scheme in the fvschemes. There's no simpler alternative. Of course, you always have the option to https://pureplantpleasures.com program your own scheme if needed.
Last edited by Kaley2; May 1, 2024 at 10:09. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Guide: Writing Equations in LaTeX on the CFD Online Forums | pete | Site Help, Feedback & Discussions | 27 | May 19, 2022 03:19 |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 06:27 |
System of Equations | Nora | Main CFD Forum | 3 | June 4, 2007 01:27 |
? fluctuating equations for homogenous shear turb. | ff_fan | Main CFD Forum | 1 | September 20, 2002 07:39 |
CONSERVATION EQUATIONS IN NONINERTIAL SYSTEM!!! | zhang zhanwang | Main CFD Forum | 0 | August 17, 1998 07:38 |