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

codedMixed BC runs fine in serial run but crashes in parallel run

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2023, 23:58
Default codedMixed BC runs fine in serial run but crashes in parallel run
  #1
New Member
 
parth
Join Date: Feb 2020
Posts: 23
Rep Power: 6
parthigcar is on a distinguished road
I am trying to implement codedMixed boundary condition at the fluid-solid interface to emulate boiling heat transfer. During Tw<Tsat I compare Q_solid = - Q_fluid, similar to turbulentTemperatureRadCoupledMixed boundary condition. However, during Tw>Tsat conditions, I compare Q_solid = - Qboiling. Where Qboiling is obtained from the boiling heat transfer correlations.

Now, this boundary condition works fine for the serial runs. However, I get sigSegv error for parallel run. Can anybody help me where I am doing wrong?

Below is the implementation of the codedMixedBC:

Code:
 vessel1_to_water
    {
        type            codedMixed;
        value           uniform 300;
        name            temperatureHeatFluxvessel1;
        refValue        uniform 300;
        refGradient     uniform 0;
        valueFraction   uniform 0;      //1 - Dirictlect ;  0 - Neumann

        code
        #{
             

        // constant saturation temperature
        const scalar Tsat = 373.15;                 // k
        scalar kf = 0.5;                            // w/m/k, thermal conductivity of water
        scalar l = 0.36;                            // m
        const scalar Tchf = 273.15 + 100 + 30;            // chf temperature
        scalar mul = 1.67e-3;                       // Pa.s, viscosity of water
        scalar hfg = 40.63e3;                       // J/mol, enthalpy of vaporization
        scalar rhov = 0.5782498;                    // water vapor density
        scalar rhol = 1000;                         // water density
        scalar sigma = 0.0589;                      // N/m, surface tensino of liquid-vapor interface
        scalar Csf = 0.0130;                        // experimental constant that depends on surface-fluid combination
        scalar Cpl = 4184;                          // J/kg/k, specific heat capacity of water
        scalar Pr = 6.9;                            // Prandtl of water
        scalar g = 9.81;                            // gravitational acceleration constant
        scalar ks = 16;                             // w/m/k, thermal conductivity of solid, steel
        scalar Tmin = 273.15 + 100 + 150;           // min temperature
        scalar kg = 0.025;                          // W/m K, water vapor thermal conductivity
        scalar mug = 1.0016e-3;                      // water vapor viscosity.

        const fvMesh &solidFvMesh = db().parent().objectRegistry::lookupObject<fvMesh>("vessel1");
        const volScalarField &solidT = solidFvMesh.thisDb().objectRegistry::lookupObject<volScalarField>("T");
        const scalarField Ts = solidT.boundaryField()[solidFvMesh.boundaryMesh().findPatchID("vessel1_to_water")];
        const fvPatch& patchsolid = solidFvMesh.boundary()[solidFvMesh.boundaryMesh().findPatchID("vessel1_to_water")];
        const fvMesh &liquidFvMesh = db().parent().objectRegistry::lookupObject<fvMesh>("water");
        const volScalarField &liquidT = liquidFvMesh.thisDb().objectRegistry::lookupObject<volScalarField>("T");
        const fvPatch& patchwater = liquidFvMesh.boundary()[liquidFvMesh.boundaryMesh().findPatchID("water_to_vessel1")];
        scalarField& Tp_(*this);
        scalarField Tgradient = Tp_ * scalar(0);
        scalar Tg = 0;

        
        forAll(Tp_, i)
        {
            if (Tp_[i] < Tsat)
            {
                this->refValue()[i] = Tp_[i];
                this->refGrad()[i] = 0.0;
                this->valueFraction()[i] = (kf*patchwater.deltaCoeffs()[i])/(kf*patchwater.deltaCoeffs()[i] + ks * patchsolid.deltaCoeffs()[i]);
            }
            else if ((Tp_[i] > Tsat) && (Tp_[i] < Tchf))
            {
                // Info << "Tp_ water" << mul * hfg * pow( g * (rhol-rhov)/sigma,0.5)* pow(Cpl*(Tp_[i]-Tsat)/Csf/hfg/Pr,3)  <<endl; //* pow(Cpl*(Tp_[i]-Tsat)/Csf/hfg/Pr,3) 
                this->refValue()[i] =  Ts[i] -mul * hfg * pow( g * (rhol-rhov)/sigma,0.5) * pow(Cpl*(Tp_[i]-Tsat)/Csf/hfg/Pr,3) / (patchsolid.deltaCoeffs()[i] * ks);
                this->refGrad()[i] = 0;
                this->valueFraction()[i] = 0.0;
                
            }
            else if (Tp_[i]> Tchf)
            {
                Info << "Temperature exceeded" <<  endl;
            }
            
        }
            #};

            codeInclude
            #{
                #include "solidThermo.H"
                #include "fluidThermo.H"
                #include "fvCFD.H"
                #include "addToRunTimeSelectionTable.H"
                #include "fvPatchFieldMapper.H"
                #include "volFields.H"
                #include "mappedPatchBase.H"
                #include "basicThermo.H"
                #include "mappedPatchFieldBase.H"
            #};

            codeOptions
            #{
                -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
                -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
                -I$(LIB_SRC)/transportModels/compressible/lnInclude \
                -I$(LIB_SRC)/finiteVolume/lnInclude \
                -I$(LIB_SRC)/meshTools/lnInclude
            #};


        }
parthigcar is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some questions about a multi region case run in parallel zfaraday OpenFOAM Running, Solving & CFD 5 February 23, 2017 10:25
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 11:58
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 18:45
Big Difference Between Serial run and Parallel run case alundilong OpenFOAM Programming & Development 1 March 20, 2013 15:52
Parallel runs with sonicDyMFoam crashes (works fine with sonicFoam) jnilsson OpenFOAM Running, Solving & CFD 0 March 9, 2012 06:45


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