Minimal scripts mechanisms#3
Conversation
| ## | ||
| ## ----------------------------------------------------------------------------- | ||
| CONSTRAINT_INFO | ||
| 4 |
There was a problem hiding this comment.
I don't quiet understand what these parameters do, but the 8s are necessary; they were 32 before which wasn't compatible with the OpenFOAM case we have apparently
There was a problem hiding this comment.
Sorry, I missed these (my notification email was set to my old Imperial account). The constraint_info specifies which cells to apply the constraint on. The idea of CPL library is to use a single grid (the CFD one) for both MD and CFD regions and then apply constraints to a subset of the cells which overlap the MD domain. In this case, 32 was the number of cells in the CFD domain
There was a problem hiding this comment.
I completely forgot to mail you about it; apologies for that!
Looks like something is wrong with my porting but didn't have enough time to properly debug the situation; will push for this over next week!
|
|
||
| //MPI_Cart_get(icomm_grid, 3, npxyz_cfd, cart_periods, cart_coords); | ||
|
|
||
| double xyzL[3] = {8*2.099495, 8*5.668637, 8*2.099495}; double xyz_orig[3] = {0.0, 0.0, 0.0}; |
There was a problem hiding this comment.
These were made so that xL_md/xl is an integer (8)
| double xyzL[3] = {8*2.099495, 8*5.668637, 8*2.099495}; double xyz_orig[3] = {0.0, 0.0, 0.0}; | ||
| int ncxyz[3] = {8, 8, 8}; | ||
| CPL::setup_cfd(CART_COMM, xyzL, xyz_orig, ncxyz); | ||
| CPL::get_arrays(&recv_array, 4, &send_array, 1); |
There was a problem hiding this comment.
4 here works with the current minimal MD; but 3 also works fine if changed on the MD side too
| MPI_Cart_create(MD_COMM, 3, npxyz, periods, 1, &CART_COMM); | ||
| double xyzL[3] = {8*2.099495, 8*5.668637, 8*2.099495}; double xyz_orig[3] = {0.0, 0.0, 0.0}; | ||
| CPL::setup_md(CART_COMM, xyzL, xyz_orig); | ||
| CPL::get_arrays(&recv_array, 1, &send_array, 4); |
There was a problem hiding this comment.
4 here works with the minimal CFD script, 3 also works if changed on the CFD side too
BUT doesn't work with the OpenFOAM socket; the socket seems to expect 3 elements only.
With 3 elements; the coupled simulation hangs:
Reading field p
Reading field U
Reading/calculating face flux field phi
CPLSocketFOAM: Analysing processor and mesh topology
CPLSocketFOAM: Defining new MPI Cartesian communicator
interp_BCtrue
Creating block mesh topology
OpenFOAM CPL topology initialisation complete
well at least the topology initialization is complete :)
There was a problem hiding this comment.
LAMMPS also expects 3 elements. looks like it also hangs when used with minimal CFD:
...
Lammps FixCPLForce forcetype: Velocity with args 1.0
cnstFCells: 8 8 8
ifix 6 Class fix cplfix
WARNING: One or more dynamic groups may not be updated at correct point in timestep (../fix_group.cpp:171)
Setting up Verlet run ...
Unit style : lj
Current step : 10000
Time step : 0.005
There was a problem hiding this comment.
The number of elements have to match. LAMMPS should send 4 as it packages up the 1 density (or count of number of molecules) and 3 components of velocity (1+3=4). We'll need to adaprt this to maybe include some phase field variables and maybe temperature. For the CFD, it simply sends the 3 components of velocity field (as pressure is not used in the constraints of Nie et al 2004), although stress coupling would send 9 components of the stress tensor.
|
Okay, let me know and I can help
From: Mohammed Elwardi Fadeli ***@***.***>
Sent: 27 May 2022 10:18
To: Crompulence/CPL_APP_OPENFOAM-3.0.1 ***@***.***>
Cc: Edward Smith (Staff) ***@***.***>; Comment ***@***.***>
Subject: Re: [Crompulence/CPL_APP_OPENFOAM-3.0.1] Minimal scripts mechanisms (PR #3)
@FoamScience commented on this pull request.
________________________________
In examples/LAMMPS_OPENFOAM/cpl/COUPLER.in<#3 (comment)>:
+##############################################################################
+##
+## Specify constraint information
+##
+## 1. constraint_algo 0-off, 1-OCT, 2-NCER, 3-Flekkoy 4-CV
+## 2. constraint_CVflag -- Use CV form of constraint 0-Off 1-On
+## 3. icmin_cnst
+## 4. icmax_cnst
+## 5. jcmin_cnst
+## 6. jcmax_cnst
+## 7. kcmin_cnst
+## 8. kcmax_cnst
+##
+## -----------------------------------------------------------------------------
+CONSTRAINT_INFO
+4
I completely forgot to mail you about it; apologies for that!
Looks like something is wrong with my porting but didn't have enough time to properly debug the situation; will push for this over next week!
—
Reply to this email directly, view it on GitHub<#3 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADF7LUI2EJ3C7JS3BP5PPHTVMCHNTANCNFSM5WPNEWJA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
So, apparently I had a faulty
COUPLER.infile; The minimal scripts couldn't work on their own with it. It's now fixed (to some extent).Check comments in these files for more info:
minimal_CFD.cpp,minimal_MD.cpp,cpl/COUPLER.inandrun_min_MD.sh