CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to acess the cell volumes and use them in the equations?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2022, 05:49
Default How to acess the cell volumes and use them in the equations?
  #1
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 97
Rep Power: 5
saicharan662000@gmail.com is on a distinguished road
Hello everyone,


I am new to openfoam. I am calculating interface area . I wore a subroutine in twoPhaseMixtureThermo.C in compressibleInterFoam solver. I used the following subroutine in twoPhaseMixtureThermo.C to use cell volume .


Code:
const volScalarField& cellVolume =
        alpha1().db().lookupObject<volScalarField>("cellVolu");
And in createFields.H I wrote the following subroutine.


Code:
volScalarField cellVolume
    (
    IOobject
       (
        "cellVolume",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
       ),
        mesh,
    dimensionedScalar("zero", dimVolume, 0.0)
    );
     cellVolume.ref() = mesh.V();
Now I am getting the following error while running test case:


Create time

Create mesh for time = 0


PIMPLE: No convergence criteria found


PIMPLE: Operating solver in transient mode with 1 outer corrector
PIMPLE: Operating solver in PISO mode


Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Constructing twoPhaseMixtureThermo

Reading field interfaceArea



--> FOAM FATAL ERROR:

request for volScalarField cellVolu from objectRegistry region0 failed
available objects of type volScalarField are


9
(
thermo:mu
interfaceProperties:K
thermosi
alpha.water
p_rgh
p
T
alpha.air
thermo:alpha
)


From function const Type& Foam:bjectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]
in file /opt/openfoam8/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 211.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const& Foam:bjectRegistry::lookupObject<Foam::Geometric Field<double, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/myCompressibleInterFoam_1"
#3 Foam::twoPhaseMixtureThermo::interfaceArea() const at ??:?
#4 Foam::twoPhaseMixtureThermo::mDotAlphal() const at ??:?
#5 Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo (Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#6 ? in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/myCompressibleInterFoam_1"
#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8 ? in "/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/bin/myCompressibleInterFoam_1"
Aborted (core dumped)



Can anyone help me with this?
Thanks in advance
saicharan662000@gmail.com is offline   Reply With Quote

Reply

Tags
compressible multiphase, compressibleinterfoam, openfoam, openfoam 8


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 13:13.