|
[Sponsors] |
March 25, 2013, 05:05 |
Dimension Problem in If Condition
|
#1 | ||||
Senior Member
|
Hi Foamers,
I would like to implement a new cavitation solver in openFoam! I added a transport equation for mass fraction where I need to compare my local pressure (p) with a scalar experimental value pEq! During the compiling of the code I got a dimension error! Can anyone help me to fix it? Here is the transport equation code: Quote:
Quote:
Quote:
Quote:
|
|||||
March 26, 2013, 09:03 |
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 |
I am not sure if you can construct the fvScalarMatrix f4Eqn in the way just you described.
The following is an example: Code:
// Declare the volScalarField coeff1 volScalarField coeff1 ( IOobject ( "coeff1", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar ( "coeff1", AdL.dimensions(), 0 ) ); forAll(coeff1, i) { if (pEq.value() > p[i]) { coeff1[i] = AdL; // or AdL[i] } else { coeff1[i] = AaL; // or AaL[i] } } fvScalarMatrix f4Eqn ( fvm::ddt(rho, f4) + fvm::div(rhoPhi /*phi*/, f4) - fvm::laplacian(Gamma4,f4) + fvm::Sp(coeff1,f4) ); *** Fumiya |
|
March 26, 2013, 09:13 |
|
#3 |
Senior Member
|
Hi Fumija,
First of all, thanks for the reply! Why are you not sure? I would ask you a more question about phi and rhoPhi in the divergence term! My model has a variable density! The other multiphase solver use rhoPhi! I did not understand its meaning! Is it required just when VOF method is used? Can I leave just phi of I must adjust this value with my mixture density? I hope that you (or some else foamers) can explain to me! Thanks in advance Regards Marco |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary condition for compressible flow ( cavity lid problem) | pike@91 | Main CFD Forum | 2 | June 2, 2012 18:04 |
Boundary condition problem | ali hemmati | FLUENT | 0 | May 23, 2012 14:12 |
Problem with a periodic boundary condition | chuck209 | CFX | 10 | May 9, 2012 17:15 |
Transient Simulation: Boundary Condition Problem | Shafiul | CFX | 7 | January 11, 2011 17:40 |
boundary condition problem | maxims | Main CFD Forum | 4 | October 10, 2010 22:34 |