From 00dc2108de54cc4ebf62c033cf9082705b419e0d Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 29 Oct 2015 15:29:08 +0000 Subject: [PATCH] Memory optimisation --- applications/solvers/coupled/MRFPorousFoam/UEqn.H | 10 +++++----- applications/solvers/coupled/MRFPorousFoam/pEqn.H | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/applications/solvers/coupled/MRFPorousFoam/UEqn.H b/applications/solvers/coupled/MRFPorousFoam/UEqn.H index ed0e2bc44..b9ccb0b8a 100644 --- a/applications/solvers/coupled/MRFPorousFoam/UEqn.H +++ b/applications/solvers/coupled/MRFPorousFoam/UEqn.H @@ -1,5 +1,5 @@ // Momentum equation - fvVectorMatrix UEqn + tmp UEqn ( fvm::ddt(U) + fvm::div(phi, U) @@ -7,9 +7,9 @@ ); // Add MRF and porous sources - mrfZones.addCoriolis(UEqn); - pZones.addResistance(UEqn); + mrfZones.addCoriolis(UEqn()); + pZones.addResistance(UEqn()); - UEqn.relax(); + UEqn().relax(); - UpEqn.insertEquation(0, UEqn); + UpEqn.insertEquation(0, UEqn()); diff --git a/applications/solvers/coupled/MRFPorousFoam/pEqn.H b/applications/solvers/coupled/MRFPorousFoam/pEqn.H index 9029b873f..134b264d4 100644 --- a/applications/solvers/coupled/MRFPorousFoam/pEqn.H +++ b/applications/solvers/coupled/MRFPorousFoam/pEqn.H @@ -2,9 +2,11 @@ surfaceScalarField rUAf ( "rUAf", - fvc::interpolate(1.0/UEqn.A()) + fvc::interpolate(1.0/UEqn().A()) ); +UEqn.clear(); + surfaceScalarField presSource ( "presSource",