Debug: Database connection successful OpenFOAM (Page 11) / Science, Technology, and Astronomy / New Mars Forums

New Mars Forums

Official discussion forum of The Mars Society plus New Mars Image Server

You are not logged in.

Announcement

Announcement: This forum is accepting new registrations via email. Please see Recruiting Topic for additional information. Write newmarsmember[at_symbol]gmail.com.

#251 Yesterday 19:15:10

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 23,880

Re: OpenFOAM

fvModels is a control file that provides "volume" heating of our 240 meter heating system for the Optical Plane vessel.

Here is what it looks like now.  We will likely have to make changes to allow it to run with the new mesh...

cat constant/fvModels

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  Field         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   Operation     | Version:  v12                                   |
|   \\  /    And           |                                                 |
|    \\/     Manipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      fvModels;
}

    uniformIntakeHeater
    {
        type        semiImplicitSource;
    //    type        bananaDoesNotExist;
        active      yes;

        select      cellSet;
        cellSet     heaterCells;

        volumeMode  absolute;   // "absolute" = total quantity over the selected region

        sources
        {
            e
            {
                explicit
                {
                    type  constant;
                    value 4e7;
                }
                implicit 0;    // 40 MW total over 24,000 cells
            }
        }
    }

// Adding new JSON to implement washer to restrict throat

washerRestriction
{
    type    porosityForce;
    active  yes;

    porosityForceCoeffs
    {
        // IMPORTANT: porosityForce expects selectionMode (cellZone is typical)
        selectionMode cellZone;
        cellZone      washerZone;

        type DarcyForchheimer;

        DarcyForchheimerCoeffs
        {
            // Start “gentle”, then ramp up by decades until leakage is negligible.
            // Strong resistance in x, minimal in y/z: Start 1e8 increment to 1e12
            d (1e9 0 0);
            f (0 0 0);

            // Align resistance with x-axis
            coordinateSystem
            {
                type cartesian;
                origin (0 0 0);
                coordinateRotation
                {
                    type axesRotation;
                    e1 (1 0 0);
                    e2 (0 1 0);
                }
            }
        }
    }
}

Right off the bat, I can see that we need to remove that washer section.

While we're waiting for ChatGPT5.2 to get back to me, I can toss in an explanation for the banana...

bananaDoesNotExist;

We used this to make sure the fluid solver was picking up fvModels correctly.  The confirmation occurred in the form of an error message reporting that bananaDoesNotExist was not found.   We saw this error message when we started the case and it hiccuped due to the incorrect name.

Looking ahead, I'm guessing we are going to have to implement cellSet in our new mesh.

That will require adding another control file, and that may be in the system folder which we have not yet addressed, other than for controlDict.

Here is ChatGPT5.2's evaluation: ( I've omitted the confirmation that the washer section needs to go. That section is removed)

One more critical check (because your new mesh is brand new)

Your heater model targets:

select      cellSet;
cellSet     heaterCells;


That means the case will only work if heaterCells exists in the new mesh.

In your new foamWorkroom mesh created by blockMesh, you currently have only:

constant/polyMesh/{boundary,faces,neighbour,owner,points}

No sets/ directory was listed, so you almost certainly do NOT yet have heaterCells. << sets was added

How to confirm

From the case directory:

ls constant/polyMesh/sets


If that directory doesn’t exist, or there’s no heaterCells, then before running you must create it (typically via topoSet using system/topoSetDict, or by switching the model to “all cells” selection).

The two clean ways forward

Option A (recommended, preserves your proven config):
Create heaterCells for the new pipe mesh using topoSet (and any other sets you rely on, like heatedWallFaces, etc.).
This keeps your fvModels exactly compatible with what you already debugged.

The next step is to look at topoSetDict in system on the running case.
(th)

Offline

Like button can go here

#252 Yesterday 22:00:34

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 23,880

Re: OpenFOAM

ChatGPT5.2 recommended a small adjustment to the control file that configures the heating volume at run time. The new mesh is slightly thinner in Z than the extendedMerlin, so I made that adjustment and ran topoSet.  Here is the log of that run:

Create time

Create polyMesh for time = 0

Reading "topoSetDict"

Time = 0s
    mesh not changed.
Created faceSet ALL_heated
    Clearing faceSet
    faceSet ALL_heated now size 0
Read set faceSet ALL_heated with size 0
    Applying source patchToFace
    Adding all faces of patch heatedWall ...
    Found matching patch heatedWall with 480 faces.
    faceSet ALL_heated now size 480
Created faceSet HEAT_set
    Clearing faceSet
    faceSet HEAT_set now size 0
Read set faceSet HEAT_set with size 0
    Applying source patchToFace
    Adding all faces of patch wallSection ...
    Found matching patch wallSection with 10 faces.
    faceSet HEAT_set now size 10
Read set faceSet HEAT_set with size 10
    Applying source boxToFace
    Adding faces with centre within boxes 1((-240.5 -10 -10) (-0.4 10 10))
    faceSet HEAT_set now size 0
Read set faceSet HEAT_set with size 0
    Applying source boundaryToFace
    Adding all boundary faces ...
    faceSet HEAT_set now size 0
Read set faceSet ALL_heated with size 480
    Applying source faceToFace
    Adding all faces from faceSet HEAT_set ...
    faceSet ALL_heated now size 480
Created cellSet heaterCells
    Applying source boxToCell
    Adding cells with center within boxes 1((-240.4 -0.2 -0.051) (-0.4 0.2 0.051))This is the revised volume heating box
    cellSet heaterCells now size 9600
End

(th)

Offline

Like button can go here

#253 Yesterday 22:07:25

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 23,880

Re: OpenFOAM

While work is proceeding in development of our new case, I restored the extendedMerlin case to "normal" by removing the washer.  I then set the case to run for a second so i can be sure it is heating properly.  The long term plan is to replace the Merlin engine with the new one, but that will not happen for a while. We can still run the engine with the 25 centimeter throat if kbd512 or GW Johnson need something from that version.

We have tested that version with 1 kg/s, 2 kg/s and 20 kg/s and it has worked flawlessly.

(th)

Offline

Like button can go here

Board footer

Powered by FluxBB