|
[Sponsors] |
Can I establish two or more fvMatrix objects in one program? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 15, 2022, 05:35 |
Can I establish two or more fvMatrix objects in one program?
|
#1 |
New Member
Chao Li
Join Date: Oct 2019
Posts: 6
Rep Power: 6 |
Dear Foamers,
Does OpenFOAM allow to establish two fvMatrix objects in one program? I tried the following code: Code:
fvVectorMatrix DEqn1 ( fvm::laplacian(impKf_, D(), "laplacian(DD,D)") - fvc::laplacian(impKf_, D(), "laplacian(DD,D)") ); fvVectorMatrix DEqn2 ( fvm::laplacian(impKf_, D(), "laplacian(DD,D)") - fvc::laplacian(impKf_, D(), "laplacian(DD,D)") ); Info << "source of DEqn1: " << DEqn1.source() << endl; Info << "source of DEqn2: " << DEqn2.source() << endl; Code:
source of DEqn1: 4{(0 0 0)} source of DEqn2: 4((0 0 0) (0 0 0) (0 0 0) (0 -27000 0)) BTW, the fvc::laplacian(impKf_, D(), "laplacian(DD,D)") is: Code:
dimensions [1 -2 -2 0 0 0 0]; internalField nonuniform List<vector> 4((0 0 0) (0 0 0) (0 0 0) (0 -180000 0)); boundaryField { top { type zeroGradient; } left { type zeroGradient; } right { type zeroGradient; } bottom { type zeroGradient; } front { type empty; } back { type empty; } } |
|
December 28, 2022, 21:45 |
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,906
Rep Power: 33 |
Why D(), ie why do you need brackets? Is there a memory leak, or a reference to temporary?
Try making a field D and repeat the exercise.it looks like your second D or second equation has got a fixedValue boundary condition on the bottom patch. I’m not sure how this happened. There are always dozens of such matrices created all the time - this must work. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
January 3, 2023, 08:33 |
|
#3 | |
New Member
Chao Li
Join Date: Oct 2019
Posts: 6
Rep Power: 6 |
Quote:
D() returns a volVectorField D_. The definition is in the base class. Code:
virtual volVectorField& D() { return D_; } |
||
Tags |
development, fvmatrix, openfoam, solids4foam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[TUTORIAL] Run fluent on distributed memory with 2 windows 7 64 bit machines | ghost82 | FLUENT | 54 | February 9, 2022 03:32 |
fvMatrix, fvOptions and SuSp: automatic implicit/explicit source-term treatment | Zeppo | OpenFOAM Programming & Development | 7 | December 15, 2021 10:20 |
Incompatible dimensions for operation | ruben23 | OpenFOAM Running, Solving & CFD | 2 | June 12, 2015 04:14 |
the openfoam source term and fvmatrix problem | wenxu | OpenFOAM Programming & Development | 0 | September 5, 2014 10:56 |
Update boundary conditions calculated by an external program | CedricVH | OpenFOAM | 2 | January 15, 2010 11:55 |