|
[Sponsors] |
![]() |
![]() |
#1 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 ![]() |
hi everyone,
i am new to openfoam , was setting up a case using twoPhaseEulerFoam solver in which phase a is water while phase b is gas and i have a salt gradient which leads to change in my rhoa (density of water) so instead of being constant its a scalar field . solver showing error on compilation. this is my createfields.H : (highlighted the required text) Info<< "Reading transportProperties\n" << endl; IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); autoPtr<phaseModel> phasea = phaseModel::New ( mesh, transportProperties, "a" ); autoPtr<phaseModel> phaseb = phaseModel::New ( mesh, transportProperties, "b" ); volVectorField& Ua = phasea->U(); surfaceScalarField& phia = phasea->phi(); // const dimensionedScalar& rhoa = phasea->rho(); const dimensionedScalar& nua = phasea->nu(); volVectorField& Ub = phaseb->U(); surfaceScalarField& phib = phaseb->phi(); const dimensionedScalar& rhob = phaseb->rho(); const dimensionedScalar& nub = phaseb->nu(); Info<< "Reading field alpha\n" << endl; volScalarField alpha ( IOobject ( "alpha", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); volScalarField beta ( IOobject ( "beta", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), scalar(1) - alpha //,alpha.boundaryField().types() ); Info<< "Reading field p\n" << endl; volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); //****************************************defining new scalar tranport Info<< "Reading field s1\n" << endl; volScalarField s1 ( IOobject ( "s1", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); const volVectorField& centres1 = mesh.C(); for (int i=0; i<mesh.nCells(); i++) { s1.internalField()[i] = 2000*centres1[i][1]; } s1.write(); Info<< "Reading field s2\n" << endl; volScalarField s2 ( IOobject ( "s2", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Info<< "Reading field rhoa\n" << endl; volScalarField rhoa ( IOobject ( "rhoa", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), ((phasea->rho)+(1041* s1))/2 ); // ************************************** end */ volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), alpha*Ua + beta*Ub ); // ****************************************** shashank -- including diffusivity for scalar transport equation dimensionedScalar diffu1 ( transportProperties.lookup("diffu1") ); dimensionedScalar diffu2 ( transportProperties.lookup("diffu2") ); // ****************************************** end dimensionedScalar Cvm ( transportProperties.lookup("Cvm") ); dimensionedScalar Cl ( transportProperties.lookup("Cl") ); dimensionedScalar Ct ( transportProperties.lookup("Ct") ); surfaceScalarField phi ( IOobject ( "phi", runTime.timeName(), mesh ), fvc::interpolate(alpha)*phia + fvc::interpolate(beta)*phib ); volScalarField rho ( IOobject ( "rho", runTime.timeName(), mesh ), alpha*rhoa + beta*rhob ); |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Artem Shaklein
Join Date: Feb 2010
Location: Russia, Izhevsk
Posts: 43
Rep Power: 16 ![]() |
Hello, shash.
I haven't found an error message in your post. Could you post it here? |
|
![]() |
![]() |
![]() |
Tags |
twophaseeulerfoam |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
SLTS+rhoPisoFoam: what is rDeltaT??? | nileshjrane | OpenFOAM Running, Solving & CFD | 4 | February 25, 2013 05:13 |
Low Mach number Compressible jet flow using LES | ankgupta8um | OpenFOAM Running, Solving & CFD | 7 | January 15, 2011 14:38 |
rho euation in rhoPisoFoam | nileshjrane | OpenFOAM Running, Solving & CFD | 4 | October 5, 2010 08:44 |
Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 13:50 |
Error log | vw.cfd | OpenFOAM | 6 | August 7, 2009 06:44 |