|
[Sponsors] |
July 8, 2012, 06:38 |
Compiling Error - Need help with C++
|
#1 | |
New Member
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
Hi all,
i just need your help in putting an Equation to C++. The following Code works fine: Code:
{ kappat = turbulence->nut()/Prt; kappat.correctBoundaryConditions(); volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat); fvScalarMatrix TEqn ( fvm::div(phi, T) - fvm::Sp(fvc::div(phi), T) - fvm::laplacian(kappaEff, T) - ((U & fvc::grad(p)) / Cp) - (((turbulence->nuEff() / Cp) * (fvc::grad(U) + fvc::grad(U)().T())) && fvc::grad(U)) ); TEqn.relax(); TEqn.solve(); rhok = 1.0 - beta*(T - TRef); } Here is the part of the equation i want to put into c++: This is my try in the code: Code:
{ kappat = turbulence->nut()/Prt; kappat.correctBoundaryConditions(); volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat); fvScalarMatrix TEqn ( fvm::div(phi, T) - fvm::Sp(fvc::div(phi), T) - fvm::laplacian(kappaEff, T) - ((U & fvc::grad(p)) / Cp) - (((turbulence->nuEff() / Cp) * (fvc::grad(U) + fvc::grad(U)().T() - (2.0/3.0 * fvm::div(U)))) && fvc::grad(U)) ); TEqn.relax(); TEqn.solve(); rhok = 1.0 - beta*(T - TRef); } Quote:
Thanks a lot! Greetings Sebastian |
||
July 8, 2012, 10:22 |
|
#2 |
New Member
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
Ok. I think i've got it. Just multiplicated the red term with the identity tensor. Now it works.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with Compiling UDFs in Ansys Fluent 13 (lnx64) | Ali.beh | Fluent UDF and Scheme Programming | 3 | August 27, 2018 04:22 |
paraview 3.10.1 compiling error (1.6-ext) | vkrastev | OpenFOAM Installation | 7 | October 28, 2011 03:17 |
Help with KIVA4 source code compiling | geothokar | Main CFD Forum | 0 | September 3, 2010 05:40 |
error msg when compiling user fortran | Ollimarc | CFX | 0 | March 13, 2008 18:16 |
Discussing UDF and C++ Compiling | Big Stone | FLUENT | 9 | April 12, 2004 15:07 |