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

New Mars Forums

Official discussion forum of The Mars Society and MarsNews.com

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.

#76 2025-06-12 19:37:44

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,633

Re: OpenFOAM

In today's report, I note that the program ran without generating Python errors, but no records were written to the cell memory file, so we have work to do there.  The main change in today's session was to stop trying to pass every parameter to the numerous functions.  Instead, we set up global memory structures for old OpenFOAM data and for the new data we are creating.  This fundamental change led to numerous rounds of testing and fixing, and at this point I haven't looked at the data to see if it is still coming out right. 
(th)

Offline

Like button can go here

#77 2025-06-18 18:51:36

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,633

Re: OpenFOAM

Today's work session was short but I am hoping it was successful. Having already created code to pull all data cleanly into memory, we are now writing each of the seven files to output so that they can be confirmed as identical to the input. We have two files already, and in this evening's work session we added three more. I'll test the new code tomorrow.

Assuming the three new files are correct, my plan for tomorrow's work session is to add the two memory files to the clean write process. These files are needed to pass data from one layer to the next.

We have already written code (multiple times) to generate new faces and to write needed data to output. I moderately confident that the procedure to create new faces can be added to this clean structure without breaking anything.

(th)

Offline

Like button can go here

#78 2025-06-19 12:42:55

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,633

Re: OpenFOAM

Today's work session went well... There are seven files to open, and seven files to write out after processing.

We completed work on all seven today, so at long last, we can return to processing the data to create new faces tomorrow.

I'll be watching like a hawk to see to it that nothing that will break the new structure is allowed to enter.  We now are reading all the data that is needed for processing into memory, and we are running a variety of checks to be sure the data we've read in is reasonable and that counts match. We also write the data from memory back out to file, and the difference program confirms the outputs match the inputs.  This moment has been a long time coming.  In retrospect, I can see that I should have thought of this long ago, but the learning curve for OpenFOAM is steep, not to mention the learning curve for Python. In any case, this report might be useful to someone approaching a similar project for the first time.

(th)

Offline

Like button can go here

#79 2025-06-23 20:15:24

tahanson43206
Moderator
Registered: 2018-04-27
Posts: 21,633

Re: OpenFOAM

Several days have gone by.... today's report is about the all important "faces" function.  The new layer program had been brought to the point where we were ready for update processing to begin. The most significant of the updates is creation of new faces.  Generating new faces requires passing information from the previous layer, and then doing lookups at run time. I ** think ** the new code might be working, but all I know at this point is that the run statistics look reasonable. I'm planning to look at the output tomorrow:

python3 layer_addition_program_V75.py
✅ points: 28380 entries loaded correctly.
✅ faces: 55814 entries loaded correctly.
✅ owner: 55814 entries loaded correctly.
✅ neighbour: 27436 entries loaded correctly.
✅ boundary: 5 patch blocks loaded correctly.
✅ All OpenFOAM files loaded into base_data.
✅ All face labels valid and complete.
✅ Added 52 new points at X=-0.4
✅ Wrote points with 28432 entries.
✅ Points updated and written.
? Generating new persistent memory cells and faces...
✅ Generated 125 new faces and updated cell memory.
✅ Wrote faces with 55939 entries.
✅ Faces copied and written
✅ Wrote owner with 55814 entries.
✅ Owner copied and written.
✅ Wrote neighbour with 27436 entries.
✅ Neighbour copied and written.
✅ Wrote boundary with 5 patches.
✅ Boundary copied and written.
✅ Persistent memory cells copied and written.
✅ Master memory copied and written.

(th)

Offline

Like button can go here

Board footer

Powered by FluxBB